<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop v1.1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<!--<title>CRM</title> -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/footer.css">
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/font_footer/iconfont.css">
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/icon_rank/iconfont.css">
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/font_my/iconfont.css">
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/icon/CRM/iconfont.css">
<link rel="stylesheet" type="text/css" href="__ROOT__ /AI_radar/js/time/DateTimePicker.css" />

<script src='__ROOT__ /AI_radar/js/jquery.js'></script>
<script src='https://res.wx.qq.com/open/js/jweixin-1.2.0.js'></script><!--微信-->
<script type="text/javascript" src="__ROOT__ /AI_radar/js/time/DateTimePicker.js"></script><!--时间选择-->
<script type="text/javascript" src="__ROOT__ /AI_radar/js/token.js"></script><!--配置文件-->
<script src="__ROOT__ /AI_radar/js/my/html2canvas.js"></script> <!--生成图片-->
<!-- missionBotR -->
<style>
/*..labelOne   */
	html,body{
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		overflow-x: hidden;
		background: #fff;
	}
	p{
		margin:0;
	}
	.vf_nav{
		position: fixed;
		bottom: 0;
		left: 0;
		color:#ccc;
	}

	.se{
		color:#666666;
	}
	.newDivdiv{
		width: 90%;
		height: 60px;
		position: fixed;
		top: 0;
		left: 5%;
		animation-duration: 2s;
		background: #fff;
		display: none

	}
	@keyframes yidongtop0 {
	      from {
	        transform:translateY(-100px);
	        opacity:0;
	      }
	      to {
	        transform:translateY(0px);
	        opacity:1;
	      }
    	}
    @keyframes yidongtop1 {
	      from {
	        transform:translateY(0px);
	        opacity:1;
	      }
	      to {
	        transform:translateY(-100px);
	        opacity:0;
	      }
    	}


    		/*顶部新加*/
	.firstTime{
		/*display: inline-block;*/
	}
	.divTime,.divTimers,.new-divTimers{
		width: calc(100% - 20px);
		margin:8px 10px;
		display: flex;
		/*border:1px solid #f6b37f;*/
		box-shadow: 0 0 10px #ddd;
		border-radius: 3px;
		background: #fff;
	}
	.divTimeRank,.divTimeRanks{
		width: calc(100% - 20px);
		margin:5px 10px;
		display: flex;
		border:1px solid #1D901B;
		border-radius: 3px;
		background: #fff;
	}
	.divTimeRankL{
		width: 100%;
	}
	.divTimeL,.new-divTimeL{
		width: calc(100% - 30px)
	}
	.divTimeR{
		width: 30px;
	}
	.divTimeLT{
		width: 100%;
		display: flex;
	}
	.divTimeImg{
		width: 1.3rem;
		height: 1.3rem;
		margin: 0.1rem 0.2rem;
	}
	.divTimeImg img{
		width: 100%;
		height: 100%;
	}
	.divTimeName{
		width: calc(100% - 30px);
		line-height: 1.5rem;
	}
	.divTimeNames{
		font-size: 13px;
		text-indent: 3px;
	}
	.divTimetime{
		text-indent: 3px;
		font-size: 10px;
	}
	.divTimeLB{
		line-height: 1.5rem;
		text-indent: 5px;
		font-size: 12px;

	}
	.divTimeR{
		line-height: 3rem;
		color:#f6b37f;
	}
	.divTimeRR,.new-divTimeRR{
		line-height: 3rem;
		color:#f6b37f;
	}
	.divDaysP{
		text-indent: 10px;
		font-size: 13px;
		margin:0;
		line-height: 25px;

	}

	.sesDiv{
		border:1px solid #f6b37f;
		background: #fff;
		border-radius: 3px;
	}
	.sesColor{
		text-align: center;
		color:#f6b37f;
		width: 3rem;
		line-height: 3rem;
	}
	.sesL{
		width: 3rem;
		height: 3rem;
		margin:5px;
		position: relative;
	}
	.sesL img{
		width: 3rem;
		height: 3rem;
		border-radius: 3px;
	}
	#index{
		width: 100%;
		height: calc(100% - 61px)
	}
	.indexHt{
		width: 100%;
		height: 100%;
		position: relative;
		overflow:hidden;
	}
	#index,#books,#information,#myselfss{
		display: none;
	}
	/*index*/
		#tuandel1{
		font-size: 22px;
	}
	/*时间*/
/*	#footer{
		width: 100%;
		height: 50px;
		position: fixed;
		bottom: 0;
		left: 0;
	}*/
	.indexFTop{
		width: 100%;
		height: 55px;
	}
	.centerTime,.centerBehavior,.centerPeoper{
		width: 100%;
		height: calc(100% - 60px);
		overflow-y: auto;
		position: relative;
	}
	.first{
		width: 80%;
		height: 35px;
		margin:10px 10%;
		display: flex;
	}

	.parallelogram {
		width: 33.33%;
		height: 35px;
		/*margin-left:20px; */
		-webkit-transform: skew(-20deg);
		-moz-transform: skew(-20deg);
		-o-transform: skew(-20deg);
		background: #eee;
	}
	/*#parallelogram1{
		margin-left:20px;
	}*/
	.firsts{
		width: 80%;
		height: 35px;
		position: absolute;
		top: 10px;
		left: 10%;
		display: flex;
	}

	.time{
		width: calc(100% - 20px);
		padding: 0 10px;
	}
	.timeP{
		line-height: 20px;

	}
	.timeY{
		width: 100%;
		/*height: 155px;*/
		border-radius: 2px;
		/*border:1px solid #ccc;*/
		box-shadow: 0 0 10px #ddd;
		margin:15px 0;
	}
	.timeY-p{
		text-align: center;
		line-height: 30px;
		border-bottom: 1px solid #eee;
	}
	.timeYT{
		width: 100%;
		height: 100px;
		display: flex;
	}
	.timeYTL,.timeYTB{
		width: 35%;
		height: 100%;
		text-align: center;
	}
	.timeYTC{
		width: 30%;
		height: 100%;
	}
	.timeK{
		width: 100%;
		height: 20px;
	}
	.shu,.timeJ{
		margin:0;
		font-size: 1rem;
		line-height: 25px;
		text-align: center;

	}
	.shu{
		font-weight: bold;
	}
	.timeYB{
		border-top: 1px solid #eee;
		width: 100%;
		display: flex;
	}
	.timeYBL{
		width: 50px;
	}
	.timeYBC{
		width: calc(100% - 80px);
		line-height: 35px;
		color:#1963AA;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.timeYBR{
		width: 30px;
		line-height: 35px;
	}
	.imgL{
		width: 25px;
		height: 25px;
		border-radius: 50%;
		margin: 5px 0 0 20px;
	}
	.imgR{
		width: 11px;
		height: 20px;
		margin: 8px 0 0 0;
	}
	.timeB{
		width: 90%;
		height: 155px;
		border-radius: 5px;
		border:1px solid #ccc;
		margin:15px 5%;
	}
	.timeBT{
		width: calc(100% - 20px);
		height: 120px;
		padding: 0 10px;
		display: inline-block;
	}
	.timeBB{
		border-top: 1px solid #ccc;
		width: 100%;
		display: flex;
	}
	.timeBBC{
		width: calc(100% - 30px);
		line-height: 35px;
		color:#1963AA;
		text-indent: 20px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.timeBBR{
		width: 30px;
		line-height: 35px;
	}
	.noneP{
		line-height: 30px;
		font-size: 1rem;
		text-align: center;
		margin-top:10px;
		color: #333333;
	}
	.chuang{
		color:#1963AA;
		line-height: 30px;
		font-size: 1rem;
		text-align: center;
	}
	.timeYes{
		width: 90%;
		height: 120px;
		padding: 0 5%;
	}
	.tou{
		display: inline-block;
		color:#444444;
		font-size: 13px;
		line-height: 25px;
		margin-top: 15px;
	}
	.mission{
		/*border-top: 1px solid #ccc;*/
		width: 100%;
		display: flex;
	}
	.missionImg{
		width: 30px;
	}
	.missionFont{
		width: calc(100% - 80px);
		line-height: 30px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.missionJin{
		width: 50px;
		line-height: 30px;
		text-align: right;
		color:#444444;
	}
	.missionImg img{
		width: 20px;
		height: 20px;
		margin: 5px 0 0 0px;
	}
	.foncolors{
		width: 33.33%;
		line-height: 35px;
		text-align: center;
	}
	.baccolor{
		background: #1963AA;
	}
	.foncolor{
		color:#fff;
	}


	/*人*/
	.top{
		width: calc(100% - 20px);
		padding: 0 10px;
		display: flex;
		border-bottom: 1px solid #eee;
	}
	.topL{
		width: calc(100% - 30px);
		line-height: 40px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.topR{
		margin-top: 7px;
		width: 26px;
		height: 26px;
		display: inline-block;
	}
	.topR img{
		width: 100%;
		height: 100%;
	}
	.centerPeoperss{
		width: 100%;
	}
	.one{
		width: 100%;
		padding: 10px 10px;
		display: flex;
		border-bottom: 1px solid #eee;
	}
	.ongImg{
		width: 40px;
		height: 40px;
		border-radius: 50%;
	}
	.ongImg img{
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}
	.oneName{
		width: calc(100% - 90px);
		line-height: 40px;
		text-indent: 10px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.activityoneName{
		width: calc(100% - 100px);
		line-height: 40px;
		text-indent: 10px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.activityoneTi{
		width: 80px;
		text-align: right;
	}
	.activityoneTiT{
		margin-top: 5px;
		line-height: 15px;
		font-size: 12px;
		color: #666666;
	}
	.activityoneTiB{
		line-height: 15px;
		font-size: 12px;
	}
	.oneNames{
		width: calc(100% - 60px);
		line-height: 40px;
		display: flex;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.oneNamesL{
		/*width: 70px;*/
		text-indent: 10px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.oneNamesR{
		width: calc(100% - 60px);
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.oneNamesRspan{
		color: #4f81d4;
	}
	.oneRight{
		width: 20px;
		line-height: 40px;

	}
	.shuPeoper{
		line-height: 40px;
		text-align: center;
		color: #ccc;

	}

	/*行为*/
	.behaviorC{
		width: calc(100% - 22px);
		padding: 0 10px;
	}
	.behaviorCZ{
		width: 100%;
		border:1px solid #ccc;
		border-radius: 5px;
	}
	.behhe{
		width: calc(50% - 4px);
		height: 80px;
		display: inline-block;
	}
	.behZ{
		width: 96px;
		height: 26px;
		margin: auto;
		vertical-align: middle;
		display: flex;
	}
	.behImg{
		width: 26px;
		height: 23px;
	}
	.behImg img{
		width: 100%;
		height: 100%;
	}
	.berFont{
		line-height: 23px;
		text-indent: 5px;
	}
	.bhz1{
		padding-top: 37px;
	}
	.bhz2{
		padding-top: 17px;
	}
	.behaviorOne{
		width: calc(100% - 20px);
		display: flex;
		padding: 10px 10px;
		border-bottom:1px solid #eaeaea;
	}
	.behaviorOne1{
		width: 35px;
		text-align: center;
	}
	.behaviorOne1 img{
		width: 25px;
		height: 25px;
		margin: 5px 0 0 5px;
	}
	.behaviorOne2{
		width: calc(100% - 70px);
		line-height: 35px;
		text-indent: 10px;
		font-size: 14px;
	}
	.behaviorOne3{
		width: 35px;
		text-align: right;
		line-height: 35px;
		font-size: 14px;
	}
	.iconfonts{
		font-size: 22px;
		color: #4f81d4;
	}

	.behaviorCZT{
		width: 100%;
		display: flex;
		padding-top: 25px;
	}
	.behaviorCZB{
		width: 100%;
		display: flex;
		padding-top: 5px;
	}
	.behaviorCZL{
		flex: 1;
		height: 55px;

	}
	.behaviorCZLN{
		width: 95px;
		position: relative;
		margin: auto;
		text-align: center;
	}
	.behaviorCZLNL{
		width: 25px;
		position: absolute;
		top: 0;
		left: 0;
		font-size: 20px;
	}
	.behaviorCZLNR{
		width: 70px;
		margin-left: 20px;
		font-size: 14px;
	}
	.behaviorCZLNRT{
		line-height: 20px;
	}
	.behaviorCZLNRB{
		line-height: 20px;
		text-align: center;
		color: #4f81d4;
	}
	.centerPeoperssD,.centerPeoperssD2{
		width: 100%;
		height: 65px;
		line-height: 45px;
		font-size: 14px;
		color: #666666;
		text-align: center;

	}

	/*时间选择弹框*/
	.xuan,.xuan2{
		width: 100%;
		height: 100%;
		background: rgba(0,0,0,0.5);
		position: fixed;
		top: 0;
		margin: 0;
		display: none;
	}
	.xuanN{
		width: 90%;
		height: 180px;
		margin-top: calc(50% - 0px);
		margin-left: 5%;
		background: #fff;
		border:1px solid #ccc;
	}
	.xuanT{
		line-height: 50px;
		text-align: center;
	}
	.xuanC{
		margin-top: 20px;
		text-align: center;
	}

	.xuabIpute{
		width: 40%;
		height: 30px;
		text-align: center;
	}
	.divBtn{
		/*width: calc(100% - 20px);*/
		width: 100%;
		height: 45px;
		margin-top:30px;
		display: flex;
		/*padding: 0 10%;*/
	}
	.btns{
		width: 20%;
		height: 35px;
		text-align: center;
		line-height: 35px;
		border-radius: 3px;
		margin:0 15%;
	}
	.btnNo{
		/*border:1px solid #ccc;*/
	}
	.btnYeso,.btnYeso2{
		/*background: #1963AA;*/
		color:#1963AA;
	}



	/*information*/

	/*没有消息*/
	.center{
		width: 100%;
		background: #eee;
	}
	.one{
		width: calc(100% - 20px);
		padding: 15px 10px;
		font-size: 13px;
		border-bottom: 1px solid #eaeaea;
	}
	.missionKon{
		width: 100%;
		margin-top: 30px;
		display: inline-block;

	}
	.missionKon img{
		width: 20%;
		margin-left: 40%;
	}
	.konP{
		color:#555555;
		text-align: center;
		font-size: 15px;
		line-height: 30px;
	}

	/*有消息*/
	.missionBot{
		width: calc(100% - 20px);
		height: 40px;
		padding: 10px 10px;
		border-bottom: 1px solid #eaeaea;
		display: flex;
		overflow:hidden;

	}
	.missionBotL{
		width: 40px;
		height: 40px;
		position: relative;
	}
	.missionBotL img{
		width: 40px;
		height: 40px;
		border-radius: 3px;
	}
	.missionBotC{
		width: calc(100% - 120px);

	}
	.missP1{
		font-weight: bold;
		height: 25px;
		line-height: 25px;
		font-size: 14px;
		text-indent: 10px;
		overflow:hidden;
	}
	.missP2{
		width: 100%;
		height: 16px;
		font-size: 12px;
		line-height: 22px;
		text-indent: 10px;
		overflow:hidden;
		text-overflow:ellipsis;
  		white-space: nowrap;
  		padding: 0 0 10px 0;
	}
	.missionBotR{
		width: 80px;
		font-size: 13px;
		text-align: right;
		line-height: 20px;
	}
	.missionNum{
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: red;
		color: #fff;
		font-size: 10px;
		text-align: center;
		line-height: 16px;
		position:absolute;
		top: -5px;
		right: -5px;
	}




	/*books*/
	/*.ongImg*/
	#books{
		width: 100%;
		height: 100%;
		background: #fff;
	}
	.book{
		width: 100%;
		height: 100%;
	}
	.bookSou{
		width: calc(100% - 20px);
		padding: 10px;
		display: flex;
	}
	.bookSou input{
		width: calc(100% - 40px);

	}
	.souBtn{
		width: 30px;
		margin-left: 10px;
		line-height: 30px;
		text-align: center;
		border:1px solid #ccc;
		border-radius: 3px;
	}
	.bookTop{
		width: 100%;
		padding: 5px 0;
		border-bottom:1px solid #ddd;
		border-top:1px solid #ddd;

	}
	.bookN{
		width: 220px;
		margin:auto;
		display: flex;
		font-size: 17px;
	}
	.bookNL,.bookNR{
		width: 110px;
		text-align: center;
		line-height: 45px;
	}
	.bookfes{
		color: #1963AA;
		border-bottom: 1px solid #1963AA;
	}
	.bookCenter{
		width: calc(100% - 20px);
		background: #fff;
		padding: 0 10px;
	}
	.bookCx{
		line-height: 30px;
		padding: 10px 0;
		font-weight: bold;
		border-bottom:1px solid #ccc;
	}
	.bookCBot{
		width: calc(100% - 10px);
		padding: 0 5px;
		display: flex;
		border-bottom: 1px solid #ccc;
	}
	.booksh{
		display: none
	}
	.bookCenterB{
		width: 100%;
		height: 100%;
		position: relative;
	}
	.bookCenterBCang{
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
		background: rgba(0,0,0,0.5);
		display: none;
	}
	.bookXuan{
		flex: 1;
		text-align: center;
		line-height: 30px;
		padding:10px 0;
		font-size: 15px;
	}
	.colorBook{
		color: #428bca;
	}
	.bookAdd{
		width: calc(100% - 20px);
		background: #fff;
		padding: 0 10px;
		display: none;
	}
	.bookAddOne{
		width: 100%;
		line-height: 30px;
		padding: 10px 0;
		color:#4f81d4;
	}

/*myBottom*/
	.myZ{
		position: relative;
	}
	.myTop{
		width: 100%;
		height: 200px;
		border-bottom: 1px solid #eee;
		background: #fff;
	}
	.mylan{
		width: 100%;
		height: 150px;
		background: #4f81d4;
	}
	.myBot{
		width: 90%;
		height: 160px;
		border:1px solid #ccc;
		border-radius: 5px;
		box-shadow: 0 0 10px #4f81d4;
		position: absolute;
		top: 20px;
		left: 5%;
		background: #fff;
	}
	.myBotT{
		width: calc(100% - 20px);
		height: 80px;
		display: flex;
		padding: 15px 10px;
		border-bottom: 1px solid #eaeaea;
	}
	.myBotTL{
		width: 80px;
	}
	.myBotTC{
		width: calc(100% - 95px);
	}
	.myBotTR{
		width: 15px;
		line-height: 80px;
	}
	.mynameM{
		text-indent: 10px;
		line-height: 40px;
		font-size: 18px;
		font-weight: bold;
	}
	.mynameZ,.mynameG{
		text-indent: 10px;
		font-size: 14px;
		color: #444444;
	}
	.myBotTL img{
		width: 80px;
		height: 80px
	}
	.myBotB{
		width: 100%;
		display: flex;
		margin-top: 15px;
	}
	.myBotBL,.myBotBR{
		width: calc(50% - 2px);
		position: relative;
		display: flex;
	}
	.myBotBlZ,.myBotBRZ{
		width: 20px;
	}
	.myBotBlZ{
		margin-left: 10px;
	}
	.myBotBlZ img{
		width: 20px;
		height: 20px;
	}
	.myBotBRZ img{
		width: 20px;
		height: 20px;
	}
	.myBotBlO,.myBotBRO{
		text-indent: 3px;
		width: 75px;
		font-weight: bold;
	}
	.myBotBlY,.myBotBRY{
		width: 17px;
	}
	.myBotBlY img{
		width: 17px;
		height: 17px;
	}
	.myBotBRY img{
		width: 17px;
		height: 17px;
	}
	.myBotBRZ{
		position: absolute;
		top:0;
		right: 105px;
	}
	.myBotBRO{
		position: absolute;
		top:0;
		right: 30px;
	}
	.myBotBRY{
		position: absolute;
		top:0;
		right: 10px;
	}
	.myBottom{
		background: #fff;
	}
	.myBottomOne{
		width: calc(100% - 20px);
		padding: 10px 10px;
		display: flex;
		border-bottom: 1px solid #eaeaea;
	}
	.myBottomOneL{
		width: 35px;
	}
	.myBottomOneL img{
		width: 35px;
		height: 35px;
	}
	.myBottomOneC{
		width: calc(100% - 55px);
		line-height: 35px;
		text-indent: 10px;
		font-size: 15px;
	}
	.myBottomOneR{
		width: 20px;
		text-align: right;
		line-height: 35px;
		font-size: 17px;
	}


	/*成交率漏斗*/
	/*.bookTop*/
	.bossCenZTopCHead{
        text-align: center;
        line-height: 50px;
        /*background: #ddd;*/
        border-bottom:1px solid #ddd;
    }
    .bossCenZTopCN{
        padding-top: 15px;
        background: #fff;
    }
    .bossCenZTopCNO{
        width: 100%;
        position: relative;
        margin-bottom: 5px;
    }
    .bossCenZTopCNO1{
        width: 100%;
        position: relative;
    }
    .bossCenZTopCNOt {
        border-top: 35px solid #FF5F1A;
        border-left: 25px solid transparent;
        border-right: 25px solid transparent;
        height: 0;
        width: 50%;
        margin: auto;
    }
    .bossCenZTopCNOz{
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-align: center;
        line-height: 35px;
        color: #fff;
        /*z-index: 99;*/
    }
    .bossCenZTopCNOw{
        width: 80px;
        line-height: 35px;
        position: absolute;
        top: 0;
        left: 82%
    }
    .bossCenZTopCNOt1 {
        border-top: 35px solid #FEAB2B;
        border-left: 25px solid transparent;
        border-right: 25px solid transparent;
        height: 0;
        width: 35%;
        margin: auto;
    }
    .bossCenZTopCNOz1{
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-align: center;
        line-height: 35px;
        color: #fff;
    }
    .bossCenZTopCNOw1{
        width: 80px;
        line-height: 35px;
        position: absolute;
        top: 0;
        left: 74%
    }
    .bossCenZTopCNOt2 {
        border-top: 35px solid #0FD35D;
        border-left: 25px solid transparent;
        border-right: 25px solid transparent;
        height: 0;
        width: 20%;
        margin: auto;
    }
    .bossCenZTopCNOz2{
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-align: center;
        line-height: 35px;
        color: #fff;
        /*z-index: 99;*/
    }
    .bossCenZTopCNOw2{
        width: 80px;
        line-height: 35px;
        position: absolute;
        top: 0;
        left: 68%
    }
    .bossCenZTopCNOt3 {
        border-top: 35px solid #3EC4D2;
        border-left: 0px solid transparent;
        border-right: 0px solid transparent;
        height: 0;
        width: 20%;
        margin: auto;
    }
    .bossCenZTopCNOz3{
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-align: center;
        line-height: 35px;
        color: #fff;
        /*z-index: 99;*/
    }
  /*  .bossCenZTopCNOw3{
        width: 80px;
        line-height: 35px;
        position: absolute;
        top: 0;xuan
        left: 64%
    }*/
    .bossCenZTopCNBot{
        width: calc(100% - 20px);
        display: flex;
        padding: 10px 10px 0 10px;
        background: #fff;
    }
    .bossCenZTopCNBotO{
        width: 33.33%;
        text-align: center;
        line-height: 35px;
        font-size: 12px;
    }
    .bossCenZTopCNBotOW{
        width: 15px;
        display: inline-block;
        position: relative;
    }
    .bossCenZTopCNBotOS{
        width: 15px;
        height: 15px;
        border-radius: 50%;
        display: inline-block;
        background: #FF5F1A;
        /*margin-top: 12.5px;*/
        position: absolute;
        top: -14px;
        right: 0;
    }
    .bossCenZTopCNBotOS1{
        width: 15px;
        height: 15px;
        border-radius: 50%;
        display: inline-block;
        background: #FEAB2B;
        position: absolute;
        top: -14px;
        right: 0;
    }
    .bossCenZTopCNBotOS2{
        width: 15px;
        height: 15px;
        border-radius: 50%;
        display: inline-block;
        background: #0FD35D;
        position: absolute;
        top: -14px;
        right: 0;
    }
    .labelOne{
    	width:calc(100% - 20px);
    	line-height: 30px;
    	padding: 10px;
    	border-bottom: 1px solid #eee;
    	font-size: 14px;
    }

    .loaderIndex{
    	width:100%;
    	line-height:30px;
    	font-size: 15px;
    	color: #666666;
		text-align: center;
    }
    .huos,.genS,.chengS{
    	display:none;
    }

   /* .bossCenZTopCNBotOS3{
        width: 15px;
        height: 15px;
        border-radius: 50%;
        display: inline-block;
        background: #0FD35D;
        position: absolute;
        top: -14px;
        right: 0;
    }*/
    /*missionNum*/
    /*bookCBot*/
/*loaderIndex*/
    /*firstTime*/
    /*.one*/

    .bookPeos1,.bookPeos2,.bookPeos3{
    	width: calc(100% - 20px);
    	padding: 15px 10px;
    	border-bottom:1px solid #ddd;
    	display:flex;
    }
    .bookPeosL{
    	width: calc(100% - 25px);
    }
    .bookPeosR{
    	width: 25px;
    	text-align: center;
    }
    .bookPeoss1,.bookPeoss2,.bookPeoss3{
    	display:none;
    	font-size: 13px;
    	/*background: #eee*/
    }
    #xiaFont12,#xiaFont22,#xiaFont32{
		font-size: 18px
    }
    #xiaFont11,#xiaFont21,#xiaFont31{
		font-size: 18px
    }

    /*人--百分比条*/
    .interactionOne{
        width: calc(100% - 20px);
        display: flex;
        line-height: 30px;
        padding: 5px 10px 0 10px;
    }
    .interactionOneL{
        width:80px;
        font-size: 13px;
    }
    .interactionOneR{
        width:calc(100% - 80px);
        display: flex;
    }
    .interactionT{
        height: 10px;
        border-radius: 5px;
        background: red;
        margin: 10px 0;
    }
    .interactionF{
        width: 80px;
        text-indent: 5px;
        font-size: 12px;
    }
    .interactionJd{
        width: 50%;
        height: 10px;
        border-radius: 5px;
        background: red;
        margin: 10px 0;
    }

	/*排行榜*/
	.rank-time{
		width: 100%;
		height: 100%;
		overflow:hidden;
	}
	.rank-top{
		width: 100%;
		height: 12rem;
		/*background: url(../../image/time/tc2.png) center center no-repeat;*/
		background: #fff;
		background-size: 100% 100%;
		display: inline-block;
		position: relative;
		border-bottom: 1px solid #eaeaea;
	}

	.rank-top-top{
		width: 100%;
		height: 8.5rem;
		background: #4f81d4;
		text-align: center;
		line-height: 2rem;
		font-size: 1rem;
	}
	.rank-top-bottom{
		width: 90%;
		height: 9rem;
		position: absolute;
		top:2rem;
		left: 5%;
		box-shadow: 0 0 10px #eee;
		background: #fff;
		/*margin: auto;*/
	}
	.rank-top-p{
		font-size: 1.1rem;
		font-weight: bold;
		line-height: 2.5rem;
		text-align: center;
		color: #ff6b62;
		letter-spacing: 2px;
	}
	.rank-topnL{
		width: 3rem;
		height: 3rem;
		margin: auto;
	}
	.rank-topnL img{
		width: 100%;
		height: 100%;
		border-radius: 50%;
		margin: auto;
	}
	.rank-top-name{
		text-align: center;
		line-height: 2rem;
		font-size: 1rem;
		font-weight: bold;
	}
	.rank-top-p2{
		text-align: center;
		color:#666666;
		font-size: 0.6rem;
		line-height: 1.5rem;
	}
	/*.rank-top-top {*/

	/*	background: -webkit-linear-gradient(#d4452d, #F3D122); !* Safari 5.1 - 6.0 *!*/

	/*	background: -o-linear-gradient(#d4452d, #F3D122); !* Opera 11.1 - 12.0 *!*/

	/*	background: -moz-linear-gradient(#d4452d, #F3D122); !* Firefox 3.6 - 15 *!*/

	/*	background: linear-gradient(#d4452d, #F3D122); !* 标准的语法 *!*/

	/*}*/


	/*.rank-topn{*/
	/*	margin-top: 60px;*/
	/*	!*text-align: center;*!*/
	/*	!*display: inline-block;*!*/
	/*	display: flex;*/
	/*}*/
	/*.rank-topZ{*/
	/*	width: 33%;*/
	/*}*/
	/*.rank-topnL,.rank-topnC{*/
	/*	!* display: flex; *!*/
	/*}*/
	/*.rank-topnL{*/
	/*	width: 30px;*/
	/*	height: 30px;*/
	/*	border-radius: 50%;*/
	/*	!*margin: 0 5px 0 0;*!*/
	/*	float: right;*/

	/*}*/
	/*.rank-topnL img{*/
	/*	width: 100%;*/
	/*	height: 100%;*/
	/*	border-radius: 50%;*/

	/*}*/
	/*.rank-topnC{*/
	/*	line-height: 30px;*/
	/*	text-indent: 5px;*/
	/*	font-size: 1.2rem;*/
	/*	color: #fff;*/
	/*	!*margin-top:-20px;*!*/
	/*	width: 67%*/
	/*}*/
	.rank-alls{
		width: 100%;
		height: calc(100% - 16.5rem);
		overflow-y: auto;
		overflow-x: hidden;
	}
/*rank-allOne*/
	.rank-oneself{
		width: calc(100% - 1rem);
		height: 3rem;
		display: flex;
		padding: 0.5rem;
		font-size: 0.9rem;
		background: #fff;
		border-bottom: 0.5rem solid #eee;
	}
	.rank-one1{
		width: calc(14% - 10px);
		text-align: center;
		line-height: 3rem;
	}
	.rank-one2{
		width: 13%;
	}
	.rank-one3{
		width: 27%;
		padding-left: 3px;
	}
	.rank-one4{
		width: 18px;
	}
	.rank-one5{
		width: calc(31% - 10px);
		padding-right: 10px;
		text-align: right;
	}
	.rank-one6{
		width: calc(12% - 10px);
		text-align: center;
	}
	.rank-imgOne2{
		width: 100%;
		/*height: 100%;*/
		vertical-align: middle;
		margin:auto;
		border-radius: 50%;

	}
	.rank-imgOne2 img{
		width: 100%;
		/*height: 100%;*/
		border-radius: 50%;
	}
	.rank-one4 img{
		width: 100%;
		/*height: 100%;*/
	}
	.rank-imgOne6{
		width: 80%;
		height: 50%;
		margin:auto;
	}
	.rank-imgOne6 img{
		width: 100%;
		height: 100%;
	}
	.rank-zhiOne3,.rank-zhiOne5{
		font-size: 0.7rem;
		color: #999999;
		line-height: 20px;
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
	}
	.rank-numOne5{
		color:#FD9800;
		font-weight: bold;

	}
	.rank-numOne6,.rank-nameOn3,.rank-numOne5{
		line-height: 25px;
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
	}
	.rank-oneselfs{
		width: calc(100% - 1rem);
		height: 3rem;
		display: flex;
		padding: 0.5rem;
		font-size: 0.9rem;
		background: #fff;
		border:1px solid #eee;
	}
	.rank-allOne{
		width: 100%;
	}
	.rank-alls-p{
		width: 100%;
		line-height: 45px;
		text-align: center;
	}
    .icon-xin-color{
        font-size: 24px;
    }
	/*赞我的人*/
    .rankUser{
		width: 100%;
		height: 100%;
		/*overflow: hidden;*/
		overflow-y: auto;
		overflow-x: hidden;

	}
	/*.rankUser-time{*/
	/*}*/
	.rankUser-one{
		width: calc(100% - 20px);
		padding: 10px 10px;
		display: flex;
		border-bottom: 1px solid #eee;
	}
	.rankUser-ongImg{
		width: 40px;
		height: 40px;
		border-radius: 50%;
	}
	.rankUser-ongImg img{
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}
	.rankUser-oneName{
		width: calc(100% - 70px);
		line-height: 40px;
		text-indent: 10px;
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
	}
	.rankUser-more{
		width: 100%;
		line-height: 45px;
		font-size: 14px;
		color: #666666;
		text-align: center;
	}




	/*优惠券分享*/
	.overflow{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.corder-wire{
		color: #4f81d4;
		border-bottom: 1px solid #4f81d4;
	}
	.background-color{
		background: #4f81d4;
		color: #fff;
		border-radius: 3px;
		text-align: center;
	}
	.discounts{
		width: 100%;
		margin: 0;
		padding: 0;
		overflow: hidden;
	}
	.discounts-head{
		width:100%;
		text-align: center;
	}
	.discounts-head-left,.discounts-head-right{
		width:100px;
		height:100%;
		line-height:45px;
		display:inline-block;
		text-align: center;
	}
	/*驾校优惠券*/
	.schoolDiscounts,.myDiscounts{
		width: 100%;
		height:calc(100% - 47px);
		overflow: hidden;
	}
	.schoolDiscounts-z{
		width: calc(100% - 30px);
		height: 100%;
		padding: 0 15px;
		overflow-y: auto;
	}
	.myDiscounts-z{
		width: calc(100% - 30px);
		height: calc(100% - 50px);
		padding: 0 15px;
		overflow-y: auto;
	}
	.myDiscounts-right-image{
		width: 50px;
		height: 50px;
		position: absolute;
		top: 0;
		right: 0;
	}

	.schoolDiscounts-one,.myDiscounts-one{
		width: 100%;
		height:150px;
		margin-top: 15px;
		position: relative;
	}
	.schoolDiscounts-one img,.schoolDiscounts-img,.myDiscounts-right-image img{
		width: 100%;
		height: 100%;
	}
	.schoolDiscounts-one-font{
		width: calc(100% - 10px);
		height:150px;
		padding: 0 5px;
		position: absolute;
		top: 0;
		left:0;
	}
	.schoolDiscounts-top{
		width: 100%;
		height: 120px;
		display: flex;
	}
	.schoolDiscounts-top-left{
		width: calc(100% - 100px);
		height: calc(100% - 20px);
		padding: 10px 5px;
		color: #fff;
	}
	.schoolDiscountsTitle{
		font-size: 22px;
		line-height: 40px;
	}
	.schoolDiscountsName{
		font-size: 15px;
		line-height: 30px;
	}
	.schoolDiscountsShop{
		font-size: 12px;
		line-height: 15px;
	}
	.schoolDiscounts-top-right{
		width: 80px;
		height: 100px;
		padding: 25px 5px 0 5px;
	}
	.schoolDiscounts-get,.schoolDiscounts-remain{
		width: 100%;
		font-size: 12px;
		line-height: 20px;
		color:#fff;
	}
	.schoolDiscounts-top-btn{
		width: 80px;
		height: 30px;
		line-height: 30px;
		font-size: 14px;
		border-radius: 15px 15px 15px 15px;
		background: #fff;
		text-align: center;
		margin-top:10px;
	}
	.schoolDiscounts-bottom{
		width: calc(100% - 10px);
		heght:30px;
		padding: 0 5px;
		line-height: 30px;
		font-size: 12px;
		color:#fff;
	}
	.myDiscounts-add{
		width: calc(100% - 30px);
		height:30px;
		padding: 10px 15px;
		position: fixed;
		bottom: 0;
		left: 0;

	}
	.myDiscounts-add-btn,.discountsAdd-btn{
		width: 100%;
		height:30px;
		line-height: 30px;
		font-size: 15px;
	}
	/*创建优惠券*/
	.discountsAdd{
		width: calc(100% - 30px);
		padding: 0 15px;
	}
	.discountsAdd-one{
		width: 100%;
		/*height: 30px;*/
		/*line-height: 30px;*/
		padding: 10px 0;
		display: flex;
	}
	.discountsAdd-one-left{
		width: 85px;
		height: 30px;
		padding-right: 5px;
		line-height: 30px;
		font-size: 15px;
		font-weight: bold;
		text-align: right;
	}
	.discountsAdd-one-right{
		width: calc(100% - 90px);
		/*height: 30px;*/
	}
	.discountsAdd-num{
		width: 90px;
		height: 24px;
		line-height: 24px;
	}
	.discountsAdd-text{
		width: 100%;
		height: 24px;
		line-height: 24px;
	}
	.discountsAdd-font{
		color:red;
		font-size: 15px;
	}
	.discountsAdd-time{
		width: 100%;
		height: 24px;
		line-height: 24px;
	}
	.myDiscounts-ones,.schoolDiscounts-ones{
		width: calc(100% - 22px);
		height: 30px;
		padding: 0 10px;
		line-height: 30px;
		display: flex;
		border-left:1px solid #ccc;
		border-right:1px solid #ccc;
		border-bottom:1px solid #ccc;
	}
	.myDiscounts-ones-delete,.myDiscounts-ones-update,.schoolDiscounts-ones-delete,.myDiscounts-ones-delete0{
		width: 50%;
		font-size: 13px;
		color:red;
	}
	.myDiscounts-ones-update{
		text-align: right;
		color:#4f81d4
	}
	.discountsAdd-end{
		width: 100%;
		border:1px solid #ccc;
		line-height: 25px;
		display: block;
	}
	/*分享*/
	.discountsShare{
		width: 100%;
		height: 100%;
	}
	.discountsShare-title{
		width: 100%;
		line-height: 40px;
		font-size: 14px;
		text-align: center;
	}
	.discountsShare-image,.discountsShare-images{
		width: 70%;
		margin: 0 15%;
		display: inline-block;
		position: relative;
		background: url("__ROOT__ /AI_radar/image/poster/shares2.jpg");
		background-size: 100% 100%;

	}
	/*.discountsShare-img,.discountsShare-imgs{*/
	/*	width: 100%;*/
	/*	height: auto;*/
	/*}*/
.discountsShare-my{
	width: 5rem;
	height: 6rem;
	margin-top: 0.5rem;
	margin-left: calc(50% - 2.5rem);
	/*position: absolute;*/
	/*top:0.5rem;*/
	/*left: calc(50% - 2.5rem);*/
}
.discountsShare-my-head{
	width: 2.2rem;
	height: 2.2rem;
	background: #fff;
	border-radius: 50%;
	padding: 0.2rem;
	margin: auto;
}
.discountsShare-head-img{
	width: 100%;
	height: 100%;
	border-radius: 50%;
}
.discountsShare-font{
	width: 100%;
	text-align: center;
}
.discountsShare-name{
	font-size: 12px;
	font-weight: bold;
	line-height: 1rem;
}
.discountsShare-company{
	font-size: 11px;
	line-height: 1rem;
}
.discountsShare-discounts{
	width: 80%;
	height: 4.5rem;
	margin: 0 10%;
	position: relative;
}
.discountsShare-discounts img{
	width: 100%;
	height: 100%;
}
.discounts-div{
	width: 100%;
	height: 4.5rem;
	position: absolute;
	top:0;
	left: 0;
	display: flex;
}
.discounts-div-left{
	width: 33%;
	line-height: 4.5rem;
	font-size: 0.8rem;
	color:#fff;
	text-align: center;
}
.discounts-div-right{
	width:67%;
	height: calc(100% - 0.5rem);
	padding: 0.25rem;
	text-indent: 0.9rem;
}
.discounts-p1{
	line-height: 1.7rem;
	font-size: 0.75rem;
	color: #F6FF02;
}
.discounts-p2{
	line-height: 1.2rem;
	font-size: 0.6rem;
	color: #fff;
}
 .discounts-p3{
	 line-height: 1.1rem;
	 font-size: 0.4rem;
	 color: #555555;
 }
 .discountsShare-discounts-particulars{
	 width: 80%;
	 margin: 1rem 10% 2rem 10%;
	 position: relative;
 }
 .discountsShare-discounts-particulars img{
	 width: 100%;
	 height: auto;
 }

.discountsShare-qrcode{
	width: 28%;
	height: 4.5rem;
	position: absolute;
	bottom: 0;
	right: 5%;
	/*left: 12%;*/
}
.discountsShare-qrcode-img{
	width: 100%;
	height: auto;
	border-radius: 50%;
}
/*.discountsShare-back{*/
/*	width: 100%;*/
/*	height:50px;*/
/*	position: fixed;*/
/*	bottom: 0px;*/
/*	left: 0;*/
/*	background: #fff;*/
/*}*/
/*.discountsShare-back-btn{*/
/*	width: calc(100% - 30px);*/
/*	height:30px;*/
/*	line-height: 30px;*/
/*	margin: 5px 15px;*/
/*}*/

	/*.discountsShare-my{*/
	/*	width: 5rem;*/
	/*	height: 6rem;*/
	/*	position: absolute;*/
	/*	top:0.5rem;*/
	/*	left: calc(50% - 2.5rem);*/
	/*}*/
	/*.discountsShare-my-head{*/
	/*	width: 2.2rem;*/
	/*	height: 2.2rem;*/
	/*	background: #fff;*/
	/*	border-radius: 50%;*/
	/*	padding: 0.2rem;*/
	/*	margin: auto;*/
	/*}*/
	/*.discountsShare-head-img{*/
	/*	width: 100%;*/
	/*	height: 100%;*/
	/*	border-radius: 50%;*/
	/*}*/
	/*.discountsShare-font{*/
	/*	width: 100%;*/
	/*	text-align: center;*/
	/*}*/
	/*.discountsShare-name{*/
	/*	font-size: 12px;*/
	/*	font-weight: bold;*/
	/*	line-height: 1rem;*/
	/*}*/
	/*.discountsShare-company{*/
	/*	font-size: 11px;*/
	/*	line-height: 1rem;*/
	/*}*/
	/*.discountsShare-qrcode{*/
	/*	width: 28%;*/
	/*	!*height: 4.5rem;*!*/
	/*	position: absolute;*/
	/*	bottom: 9%;*/
	/*	right: 15%;*/
	/*	!*left: 12%;*!*/
	/*}*/
	/*.discountsShare-qrcode-img{*/
	/*	width: 100%;*/
	/*	height: auto;*/
	/*	border-radius: 50%;*/
	/*}*/
	/*获客详情*/
	.discountsAcquire{
		width: 100%;
		height: 100%;
		background: #fff;
		position: fixed;
		top: 0;
		left: 0;
		display: none;
		overflow-y: auto;

	}
	.discountsAcquire-k{
		width: 100%;
		height: 50px;
	}
	.discountsAcquire-back{
		width: 100%;
		height: 50px;
		background: #fff;
		position: fixed;
		bottom: 0;
		left: 0;
	}
	.discountsAcquire-btn{
		width: calc(100% - 20px);
		height: 30px;
		margin: 10px;
		text-align: center;
		line-height: 30px;
		background: #4f81d4;
		color: #fff;
		border-radius: 3px;
	}



</style>
</head>
<body >
	<!-- {include file="public/wx_share" /} -->
	<div class="divs index" id="index">
		{include file="index/index" /}
		<div style="height:60px; line-height:60px; clear:both;"></div>
	</div>
	<div class="divs information" id="information">
		{include file="index/information" /}
		<div style="height:60px; line-height:60px; clear:both;"></div>
	</div>
	<div class="divs books" id="books">
		{include file="index/book" /}
		<div style="height:60px; line-height:60px; clear:both;"></div>
	</div>

	<div class="divs myselfss" id="myselfss">
		{include file="index/my" /}
	</div>

	<div class="ranking" id="ranking" style="display: none">
		{include file="radar/ranking" /}
	</div>
<!--	xuabIpute-->
 <!-- <div class="asd">sadasd</div> -->
 <!-- ｛in｝ -->


	<div class="vf_nav" style="display: none">
		<ul>
			<li>
				<a href="#index" class="se">
					<div><i class='iconfont icon-iconset0398' id='tuandel1'></i></div>
				    <div class="footrFont footrFont0">雷达</div>
				</a>
			</li>
			<li>
				<a href="#information" class="se">
					<div style="position: relative;"><i class='iconfont icon-xiaoxi' id='tuandel1'></i><div class="read" style="position: absolute;top: -2px;right: 30%;width: 16px;height: 16px;background: red;border-radius: 50%;line-height:16px;text-align: center;color: #fff;font-size: 10px;display:none"></div></div>
				    <div class="footrFont footrFont1">消息</div>
				</a>
			</li>
			<li>
				<a href="#books" class="se">
					<div><i class='iconfont icon-duorenyonghu' id='tuandel1'></i></div>
				   	<div class="footrFont footrFont2">通讯录</div>
				</a>
			</li>
			<li>
				<a href="#myselfss" class="se">
					<div><i class='iconfont icon-wode' id='tuandel1'></i></div>
				    <div class="footrFont footrFont3">我的</div>
				</a>
			</li>
		</ul>
	</div>
	<div class="newDivdiv">
		<div class="new-divTimer">
			<div class='new-divTimers'>
				<div class='new-divTimeL'>
					<div class='divTimeLT'>
						<div class='divTimeImg'>
							<img src='' class="divTimeImg-img">
						</div>
						<div class='divTimeName'>
							<span class='divTimeNames new-divTimeNames'></span>
							<span class='divTimetime new-divTimetime'></span>
						</div>
					</div>
					<div class='divTimeLB new-divTimeLB'></div>
				</div>
				<div class='new-divTimeRR clickChat'>
					<i class='iconfont icon-xiaoxi' id='tuandel1'></i>
				</div>
			</div>
		</div>
	</div>
	<!-- <div id="loadss" style="display:none;position: fixed;top: 55px;left: 0;background:rgba(0,0,0,0.9);width:100%;height: calc(100% - 55px);">
	    <div style="width:100%;height:100%;display:flex;vertical-align: middle;">
	      <div style="width:10rem;height:13rem;margin: auto;">
	        <img src="__ROOT__ /AI_radar/image/my/load.gif" alt="" class="load1Img" style="width:100%;height:auto;" />
	        <div class="loadFont" style='width:100%;text-align: center;display: block;color:#fff;font-size: 20px;'>正在查询...</div>
	      </div>
	    </div>
	</div> -->
	<div class="CRM_log" style="display:block;position: fixed;top: 0;left: 0;background:rgba(0,0,0,0);width:100%;height: 100%;">
        <div style="width:100%;height:100%;display:flex;vertical-align: middle;">
          <div style="width:3rem;height:3rem;margin: auto;">
            <img src="http://resource.17jxyx.com/goods/15537572830000.gif" alt="" class="load1Img" style="width:100%;height:auto;border-radius: 0.4rem;background: rgba(255,255,255,0.3)" />
           <!--  <div class="loadFont" style='width:100%;text-align: center;display: block;color:#fff;font-size: 20px;'>正在加载...</div> -->
          </div>
        </div>
    </div>

	<div id="dtBox"></div>
	<!--生成海报进度-->
	<div class="CRM_schedule" style="display:none;position: fixed;top: 0;left: 0;background:rgba(0,0,0,0);width:100%;height: 100%;">
		<div style="width:100%;height:100%;display:flex;vertical-align: middle;">
			<div style="width:7rem;height:7rem;margin: auto;background: #000;border-radius: 3px;">
				<div style="width:3rem;height:3rem;margin: 1rem auto;">
					<img src="http://resource.17jxyx.com/goods/15579076440000fNM8kebmEKvL3J7.4.gif" alt="" class="load1Img" style="width:100%;height:auto;border-radius: 0.4rem;background: rgba(0,0,0,0.3)" />
				</div>
				<div style="width: 100%;text-align: center;line-height: 2rem;color: #fff;font-size：0.9rem;">正在生成<span class="img-fabrication-font-num">0</span>%</div>
			</div>
		</div>
	</div>
	<canvas class="canvas" style="display:none;"></canvas>
	<canvas class="canvas2" style="display:none;"></canvas>

	<!--<div class='time'><p class='timeP'><span class='zuo'>昨天</span><span class='times'>21:00</span></p><div class='timeY'><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>3</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>3</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='__ROOT__ /AI_radar/image/footer/tp.png' class='imgL'></div><div class='timeYBC'>新华杨</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>-->
<!-- <script src='__ROOT__ /AI_radar/js/realTime.js'></script> -->

<!-- websocket连接，并在屏幕上面弹框 -->
<script type="text/javascript">
	var tokensNew = "{$token}"
    var divNew = document.querySelector(".newDivdiv")
    function newDiv(asd){
      // console.log(window.tokens.token_boss)
    	var setout;
    	var setval;
    	clearTimeout(setout)
    	clearTimeout(setval)
		// token
    	// console.log(JSON.parse(asd.data))
    	var ses = JSON.parse(asd.data)
    	// console.log(ses.type)
    	// var firstTime = document.querySelector(".firstTime")
    	// console.log($(".firstTime"))
    	if(ses.type == "behavior" || ses.type == "rank"){
    		// console.log("不是聊天")
			// $(".new-divTimer").css("display","none")
    		if($(".firstTime").length != 0){
		    	var newTimes = ''
		    	var newTimes5 = ses.stamp
    			var years = ses.year
				if(ses.type == "behavior"){
					if($(".divDays").length == 0){
						var divDay = $("<div class='divDays' divDays"+newTimes5+"'><p class='divDaysP'>"+ses.year+"</p><div class='divDaysN divDaysN"+newTimes5+"'></div</div>")
						$(divDay).appendTo(".firstTime")
						var divTimess = $("<div class='divTime'><div class='divTimeL' did='"+ses.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+ses.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+ses.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+ses.content+"</div></div><div class='divTimeR clickChat' did='"+ses.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
						$(divTimess).appendTo(".divDaysN"+newTimes5)
					}else{
						// if($(".divDaysP")[$(".divDaysP").length-1].innerHTML == ses.year){
						if($(".divDaysP")[0].innerHTML == years){
							var divTimess2 = "<div class='divTime'><div class='divTimeL' did='"+ses.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+ses.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+ses.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+ses.content+"</div></div><div class='divTimeR clickChat' did='"+ses.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>"
							$($(".divTime")[0]).before(divTimess2)
							// $(divTimess2).appendTo(".divDays"+newTimes5)
						}else{
							var divDay2 = "<div class='divDays divDays"+newTimes5+"'><p class='divDaysP'>"+years+"</p><div class='divDaysN divDaysN"+newTimes5+"'></div</div>"
							$($(".divDays")[0]).before(divDay2)
							// $(divDay2).appendTo(".firstTime")

							var divTimess = $("<div class='divTime'><div class='divTimeL' did='"+ses.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+ses.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+ses.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+ses.content+"</div></div><div class='divTimeR clickChat' did='"+ses.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
							$(divTimess).appendTo(".divDaysN"+newTimes5)
							// console.log(divTimess)
							// console.log($(".divDaysN"+newTimes5))

						}
					}
					// sesContent = ses.content
				}
				if(ses.type == "rank"){
					var sesContent = "你昨天获客"+ JSON.parse(ses.content).user_num + "，你的排名为： " + JSON.parse(ses.content).rank
					if($(".divDays").length == 0){
						var divDay = $("<div class='divDays' divDays"+newTimes5+"'><p class='divDaysP'>"+ses.year+"</p><div class='divDaysN divDaysN"+newTimes5+"'></div</div>")
						$(divDay).appendTo(".firstTime")
						var divTimess = $("<div class='time'><div class='timeY'><p class='timeY-p'>"+JSON.parse(ses.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+ses.url+"' class='imgL'></div><div class='timeYBC'>"+ses.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>")
						$(divTimess).appendTo(".divDaysN"+newTimes5)
					}else{
						// if($(".divDaysP")[$(".divDaysP").length-1].innerHTML == ses.year){
						if($(".divDaysP")[0].innerHTML == years){
							var divTimess2 = "<div class='time'><div class='timeY'><p class='timeY-p'>"+JSON.parse(ses.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+ses.url+"' class='imgL'></div><div class='timeYBC'>"+ses.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>"
							$($(".divTime")[0]).before(divTimess2)
							// $(divTimess2).appendTo(".divDays"+newTimes5)
						}else{
							var divDay2 = "<div class='divDays divDays"+newTimes5+"'><p class='divDaysP'>"+years+"</p><div class='divDaysN divDaysN"+newTimes5+"'></div</div>"
							$($(".divDays")[0]).before(divDay2)
							// $(divDay2).appendTo(".firstTime")

							var divTimess = $("<div class='time'><div class='timeY' did='"+JSON.parse(ses.content).time_info+"'><p class='timeY-p'>"+JSON.parse(ses.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(ses.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+ses.url+"' class='imgL'></div><div class='timeYBC'>"+ses.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>")
							$(divTimess).appendTo(".divDaysN"+newTimes5)
						}
					}
				}
    		}
    		dinji();
			dianji2();
			dianji3();
			divNew.style.display="block"
			// if($(".divTimers").length != 0){
			// 	var divTimers = document.querySelector(".divTimers")
			// 	divTimers.remove()
			// }
			var divTimessT
			if(ses.type == "behavior"){
				$(".divTimeImg-img").attr("src",ses.url)
				$(".new-divTimeNames").html(ses.nickname)
				$(".new-divTimeLB").html(ses.content)
				$(".new-divTimers").attr("did",ses.id)

				// $(".divTimeNames").html(ses.nickname)
				// console.log("jinhgfsdjf")
				// divTimessT = $("<a href='"+window.urls.url+"/user/message?user_id="+ses.id+"&token="+window.tokens.token_boss+"&corpid="+localStorage.getItem('CRM_corpId')+"'><div class='divTimers'><div class='divTimeL'><div class='divTimeLT'><div class='divTimeImg'><img src='"+ses.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+ses.nickname+"</span><span class='divTimetime'></span></div></div><div class='divTimeLB'>"+ses.content+"</div></div><div class='divTimeRR clickChat' did='"+ses.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div></a>")
			}
			if(ses.type == "rank"){
				var sesContent2 = "你昨天获客"+ JSON.parse(ses.content).user_num + "，你的排名为： " + JSON.parse(ses.content).rank
				divTimessT = $("<a href='?id="+JSON.parse(ses.content).time_info+"#ranking'><div class='divTimeRanks'><div class='divTimeRankL'><div class='divTimeLT'><div class='divTimeImg'><img src='"+ses.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+ses.nickname+"</span><span class='divTimetime'></span></div></div><div class='divTimeLB'>"+sesContent2+"</div></div></div></a>")
			}
		   	$(divTimessT).appendTo(".newDivdiv")
			divNew.style.animationName = 'yidongtop0'

			setout = setTimeout(function(){
				divNew.style.animationName = 'yidongtop1';
				setval = setTimeout(function(){
					// var divTimers = document.querySelector(".divTimers")
					// if(divTimers){
					// 	divTimers.remove()
					// }
					divNew.style.display="none"
				},1000)
			},6000)
    	}
    	if(ses.type == "say"){
			// $(".new-divTimer").css("display",'block')
			insertMessages(ses);//c存储聊天记录
		// 	// console.log(document.querySelector(".read").innerHTML)
		// 	document.querySelector(".read").innerHTML = parseInt(document.querySelector(".read").innerHTML) + 1
		// 	 if(document.querySelector(".read").innerHTML == 0){
		// 		document.querySelector(".read").style.display = "none"
		// 	 }else{
		// 		document.querySelector(".read").style.display = "block"
		// 	 }
		// 	var readDiv = document.querySelectorAll(".missionBot")
		// 	readDiv.forEach(function(readA,readB){
		// 	    if(readA.getAttribute("did") == ses.uid){
		// 			// console.log(readA.getAttribute("did"))
		// 			// console.log(ses)
		// 			if(ses.message_type == 1){
		//
		// 			  readA.childNodes[1].childNodes[1].innerHTML = ses.content
		// 			}
		// 			if(ses.message_type == 3){
		// 			  readA.childNodes[1].childNodes[1].innerHTML = "[图片]"
		// 			}
		// 			readA.childNodes[0].childNodes[1].innerHTML = parseInt(readA.childNodes[0].childNodes[1].innerHTML) + 1
		// 			readA.childNodes[0].childNodes[1].style.display = "block"
		//
		// 	    }
		// 	})
		// 		var divTimessT;
				divNew.style.display="block"
				$(".divTimeImg-img").attr("src",ses.head_img)
				$(".new-divTimeNames").html(ses.user_name)
		//
				$(".new-divTimers").attr("did",ses.uid)
				if(ses.message_type ==1){
					$(".new-divTimeLB").html(ses.content)
					// divTimessT = $("<a href='"+window.urls.url+"/user/message?user_id="+ses.uid+"&token="+window.tokens.token_boss+"&corpid="+localStorage.getItem('CRM_corpId')+"'><div class='divTimers sesDiv'><div class='sesL'><img src='"+ses.head_img+"' alt=''></div><div class='missionBotC'><p class='missP1'>"+ses.user_name+"</p><p class='missP2'>"+ses.content+"</p></div><div class='sesColor clickChat' did='"+ses.uid+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div></a>")
				}
				if(ses.message_type ==2){

					// divTimessT = $("<div class='divTimers sesDiv'><div class='sesL'><img src='"+ses.head_img+"' alt=''><div class='missionNum'></div></div><div class='missionBotC'><p class='missP1'>"+ses.user_name+"</p><p class='missP2'>"+ses.content+"</p></div><div class='sesColor clickChat' did='"+ses.uid+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
				}
				if(ses.message_type ==3){
					$(".new-divTimeLB").html("[图片]")
					// divTimessT = $("<a href='"+window.urls.url+"/user/message?user_id="+ses.uid+"&token="+window.tokens.token_boss+"&corpid="+localStorage.getItem('CRM_corpId')+"'><div class='divTimers sesDiv'><div class='sesL'><img src='"+ses.head_img+"' alt=''></div><div class='missionBotC'><p class='missP1'>"+ses.user_name+"</p><p class='missP2'>[图片]</p></div><div class='sesColor clickChat' did='"+ses.uid+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div></a>")
				}
				if(ses.message_type ==4){
					$(".new-divTimeLB").html("[商品]")
					// divTimessT = $("<a href='"+window.urls.url+"/user/message?user_id="+ses.uid+"&token="+window.tokens.token_boss+"&corpid="+localStorage.getItem('CRM_corpId')+"'><div class='divTimers sesDiv'><div class='sesL'><img src='"+ses.head_img+"' alt=''></div><div class='missionBotC'><p class='missP1'>"+ses.user_name+"</p><p class='missP2'>[商品]</p></div><div class='sesColor clickChat' did='"+ses.uid+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div></a>")
				}

			    // $(divTimessT).appendTo(".newDivdiv")
				divNew.style.animationName = 'yidongtop0';
				setout = setTimeout(function(){
					divNew.style.animationName = 'yidongtop1';
					setval = setTimeout(function(){
						divNew.style.display="none"
					},1000)
				},6000)
			}
		}
	$(".new-divTimers").click(function () {
		window.location.href= window.urls.url + `/user/message?user_id=${$(this).attr("did")}&token=${window.tokens.token_boss}&corpid=${localStorage.getItem("CRM_corpId")}`
	})
    //点击右边进入聊天界面
    function dinji(){
    	if($(".newDivdiv").length != 0){
			var divTimeR = document.querySelectorAll(".divTimeR")
			Array.from(divTimeR).forEach(function(a,b){
				a.onclick = function(){
					window.location.href= window.urls.url + `/user/message?user_id=${a.getAttribute("did")}&token=${window.tokens.token_boss}&corpid=${localStorage.getItem("CRM_corpId")}`
				}
			})
		}
    }
    //点击左边进入个人详情
    function dianji2(){
    	if($(".newDivdiv").length != 0){
			var divTimeL = document.querySelectorAll(".divTimeL")
			Array.from(divTimeL).forEach(function(c,d){
				c.onclick = function(){
					// console.log(c.getAttribute("did"))
					window.location.href=window.urls.url + `/book/details?id=${c.getAttribute("did")}&corpid=${localStorage.getItem("CRM_corpId")}`;
				}
			})
		}
    }
	//点击进入排行榜
	function dianji3(){
		if($(".newDivdiv").length != 0){
			var divTimeL = document.querySelectorAll(".timeY")
			Array.from(divTimeL).forEach(function(e,f){
				e.onclick = function(){
					// console.log(c.getAttribute("did"))
					window.location.href=`?id=${e.getAttribute("did")}#ranking`;
				}
			})
		}
	}

    var token = window.tokens.token_boss
	var lockReconnect = false;//避免重复连接
    var wsUrl = "wss://minitest.17jxyx.com/wss";
    var ws;
    var tt;
    function createWebSocket() {
      try {
        ws = new WebSocket(wsUrl);
        init();
      } catch(e) {
        // console.log('catch');
        reconnect(wsUrl);
      }
    }
    function init() {
      ws.onclose = function () {
        console.log('链接关闭');
        reconnect(wsUrl);
      };
      ws.onerror = function() {
        console.log('发生异常了');
        reconnect(wsUrl);
      };
      ws.onopen = function (e) {
      	var login_data = '{"type":"login","client_name":"kk","token":"'+tokensNew+'"}';
        // console.log("websocket握手成功，发送登录数据:"+login_data);
        ws.send(login_data);
        // console.log(e)
        //心跳检测重置
        heartCheck.start();
      };
      ws.onmessage = function (event) {
        //拿到任何消息都说明当前连接是正常的
        // console.log(event);
        newDiv(event)
        heartCheck.start();
      }
    }
    function reconnect(url) {
      if(lockReconnect) {
        return;
      };
      lockReconnect = true;
      //没连接上会一直重连，设置延迟避免请求过多
      tt && clearTimeout(tt);
      tt = setTimeout(function () {
        createWebSocket(url);
        lockReconnect = false;
      }, 4000);
    }
    //心跳检测
    var heartCheck = {
      timeout: 30000,
      timeoutObj: null,
      serverTimeoutObj: null,
      start: function(){
        // console.log('start');
        var self = this;
        this.timeoutObj && clearTimeout(this.timeoutObj);
        this.serverTimeoutObj && clearTimeout(this.serverTimeoutObj);
        this.timeoutObj = setTimeout(function(){
          //这里发送一个心跳，后端收到后，返回一个心跳消息，
          // console.log('心跳');
          ws.send('{"type":"pong"}');
          self.serverTimeoutObj = setTimeout(function() {
            // console.log(111);
            console.log(ws);
            ws.close();
            // createWebSocket();
          }, self.timeout);

        }, this.timeout)
      }
    }
    createWebSocket(wsUrl);

    //消息存储
    function insertMessages(message){
      // console.log(message)
      var dateTmp = message.time
	  var newTimes = dateTmp.slice(0,16)
      var info = {};
      var list = [];
      info.uid = message.uid;
      info.message_type = message.message_type;
      info.head_img = message.head_img;
      info.user_name = message.user_name;
      info.content = message.content;
      info.time = newTimes;
      var chat = localStorage.getItem('MESSAGE');
      // console.log(chat)
      // console.log(window.localStorage.getItem('MESSAGE'))

      if(chat != null){
        var arrs = JSON.parse(chat)
        var judge = true;
        for(var i = 0; i < arrs.length; i++){
          if(arrs[i].uid == info.uid){
            judge = false
            arrs[i] = info
            arrs[i].unread =  arrs[i].unread + 1

            // localStorage.setItem('MESSAGE',JSON.stringify(arrs));
          }
        }
        // console.log(arrs)
        if(judge){
          arrs.unshift(info)
          // localStorage.setItem('MESSAGE',JSON.stringify(arrs));
        }
        arrs.sort(function(a,b){
	        if(a.time>b.time){
	            return -1;
	        }
	        if(a.time<b.time){
	           return 1;
	        }
	        return 0;
	    })
        localStorage.setItem('MESSAGE',JSON.stringify(arrs));


        // console.log(arrs)
      }else{
        var arr = [];
        arr.push(info)
        // console.log(info)
        arr.sort(function(a,b){
	        if(a.time>b.time){
	            return -1;
	        }
	        if(a.time<b.time){
	           return 1;
	        }
	        return 0;
	    })
        localStorage.setItem('MESSAGE',JSON.stringify(arr));
      }
      return true;
  	}

</script>

<!-- 页面操作 -->
<script type="text/javascript">
	var config = {$config};
	var corpid = "{$corpid}";
	localStorage.setItem("CRM_corpId",corpid)

	var peoperJudge = 0;
	// console.log(corpid)
	configs()
	//微信配置--禁用功能表
	function configs(){
		// console.log(config)
		// 微信配置
		wx.config({
		    beta: true,
		    debug: false,
		    appId: config.appid,
		    timestamp: config.timestamp,
		    nonceStr: config.nonceStr,
		    signature: config.signature,
		    jsApiList: ['hideMenuItems','hideAllNonBaseMenuItem'] // 功能列表，我们要使用JS-SDK的什么功能
		});
		wx.ready(function(e){
		    // console.log(e)
		    wx.hideMenuItems({
			    menuList: ["menuItem:share:appMessage"] // 要隐藏的菜单项，所有menu项见附录3
			});
			wx.hideAllNonBaseMenuItem();

		});
		wx.error(function(res){
		    // console.log(res)
		});
	}
	// console.log(window.tokens.token_boss)
    var indexFirstTimeNum = 1;//时间页个人行为页数
    var i = 1;//时间页个人行为天数
	var timestampss = Date.parse(new Date())/1000;
	var timeFirst = timestampss - 24*60*60*7;//人--开始时间
	var timeEnds = timestampss;//人--结束时间
	var pageRen = 1;
	var sizeRen = 15;//人--每页显示人数
	var rankPage = 1;
	var rankJudge = 0;
	var centerTimeJudge = 0;
	var rankUserPage = 1;//赞我的人页数
	var rankUserJudge= 0;//赞我的人


	$(".discounts").css("height",$("body").height())
	$(".ranking").css("height",$("body").height())
	// console.log(sizeRen)
	var jin;
	var test = window.location.href;
	var jin1 = test.indexOf('#');
	var jin3 = jin1 + 1;
	if(jin1>0){
		jin = test.slice(jin3);
	}else{
		jin ="index"
	}
	var se = document.querySelectorAll(".se")
	// 关闭所有页面div
	function disNon(){
		Array.from(se).forEach(function(a,b){
			a.style.color = "#666666"
		})
		$("#index").css("display","none")
		$("#information").css("display","none")
		$("#books").css("display","none")
        $("#myselfss").css("display","none")
        $(".centerTime").css("display","none")
    	$(".firstTime").css("display","none")
	 	$(".centerBehavior").css("display","none")
	 	$(".centerPeoper").css("display","none")
		$(".ranking").css("display","none")


	}
	// console.log(jin)
	function footerPage(jin,indexFirstTimeNuma,ia){
	    configs()
	    $(".CRM_log").css("display","block")
		disNon()
		if(jin == '' || jin == "index" ||jin == "centerTime"){
			document.title = "雷达"
		    // $(".index").load("index.html");
		    centerPeoperKong()
		    informationKong()
		    indexFirstTimeNum = 1
		    i = 1
		    indexFirstTimeNuma = 1
		    ia = 1
			centerTimeJudge = 0
		    indexFirstTime(indexFirstTimeNuma,ia)
		    $("#index").css("display","block")
		    $(".centerTime").css("display","block")
		    $(".firstTime").css("display","block")
			$(".vf_nav").css("display","block")
		    $("#foncolor0").addClass("foncolor")
		 	$("#foncolor1").removeClass("foncolor")
		 	$("#foncolor2").removeClass("foncolor")
		 	$("#parallelogram0").addClass("baccolor")
		 	$("#parallelogram1").removeClass("baccolor")
		 	$("#parallelogram2").removeClass("baccolor")
		    document.querySelectorAll(".se")[0].style.color = "#1963AA"

		}
		if(jin == "centerBehavior"){
			document.title = "雷达"
			// console.log($(".firstTime").children())
			centerPeoperKong()
			firstTimeKong()
			 var timestamp = Date.parse(new Date())/1000;
			 var das = timestamp - 24*60*60*7
			 // console.log(timestamp)
			indexCenterBehavior("all",das,timestamp)
		    $("#index").css("display","block")
		    $(".centerBehavior").css("display","block")
			$(".vf_nav").css("display","block")
		    $("#foncolor0").removeClass("foncolor")
		 	$("#foncolor1").addClass("foncolor")
		 	$("#foncolor2").removeClass("foncolor")
		 	$("#parallelogram0").removeClass("baccolor")
		 	$("#parallelogram1").addClass("baccolor")
		 	$("#parallelogram2").removeClass("baccolor")
		    document.querySelectorAll(".se")[0].style.color = "#1963AA"
		    $(".indexDaysNew").html("7")

		}
		if(jin == "centerPeoper"){
			document.title = "雷达"
			firstTimeKong()
			pageRen = 1
			centerPeoper(pageRen,timeFirst,timeEnds)
		    $("#index").css("display","block")
		    $(".centerPeoper").css("display","block")
			$(".vf_nav").css("display","block")
		    $("#foncolor0").removeClass("foncolor")
		 	$("#foncolor1").removeClass("foncolor")
		 	$("#foncolor2").addClass("foncolor")
		 	$("#parallelogram0").removeClass("baccolor")
		 	$("#parallelogram1").removeClass("baccolor")
		 	$("#parallelogram2").addClass("baccolor")
		    document.querySelectorAll(".se")[0].style.color = "#1963AA"
		    $(".indexDaysNew2").html("7")


		}
		if(jin == "myselfss"){
			document.title = "我的"
			firstTimeKong()
			informationKong()
			myAjax()
			$("#myselfss").css("display","block")
			$(".discountsDiv").css("display","none")
			$("#myDiv").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[3].style.color = "#1963AA"
	    }
	    if(jin == "information"){
			document.title = "消息"
			firstTimeKong()
			informationKong()

	    	informationAjax()
			$("#information").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[1].style.color = "#1963AA"

	    }
	    if(jin == "books"){
			document.title = "通讯录"
			firstTimeKong()
			informationKong()
			bookAjax()
			$("#books").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[2].style.color = "#1963AA"
			$(".bookfe1").removeClass("bookfes");
			$(".bookfe").addClass("bookfes");
			$(".bookAdd").css("display","none");
			$(".bookCenter").css("display","block");
			if(document.querySelector(".bookPeosZ")){
      			document.querySelector(".bookPeosZ").remove()
      		}
			peoperAjax("activity")

	    }
	    if(jin == "bookfe1"){
			document.title = "通讯录"
			firstTimeKong()
			informationKong()
			bookAjax()
			$("#books").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[2].style.color = "#1963AA"
			$(".bookfe").removeClass("bookfes");
			$(".bookfe1").addClass("bookfes");
			$(".bookCenter").css("display","none");
			$(".bookAdd").css("display","block");

	    }
	    if(jin == "activity"){
			document.title = "通讯录"
			firstTimeKong()
			informationKong()
			bookAjax()
			$("#books").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[2].style.color = "#1963AA"
			$(".bookfe1").removeClass("bookfes");
			$(".bookfe").addClass("bookfes");
			$(".bookAdd").css("display","none");
			$(".bookCenter").css("display","block");
			peoperAjax("activity")
    	// $(".book").animate({scrollTop:0},10)

	    }
	    if(jin == "follow"){
			document.title = "通讯录"
			firstTimeKong()
			informationKong()
			bookAjax()
			$("#books").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[2].style.color = "#1963AA"
			$(".bookfe1").removeClass("bookfes");
			$(".bookfe").addClass("bookfes");
			$(".bookAdd").css("display","none");
			$(".bookCenter").css("display","block");
			peoperAjax("follow")
	    }
	    if(jin == "rate"){
			document.title = "通讯录"
			firstTimeKong()
			informationKong()
			bookAjax()
			$("#books").css("display","block")
			$(".vf_nav").css("display","block")
			document.querySelectorAll(".se")[2].style.color = "#1963AA"
			$(".bookfe1").removeClass("bookfes");
			$(".bookfe").addClass("bookfes");
			$(".bookAdd").css("display","none");
			$(".bookCenter").css("display","block");
			peoperAjax("rate")
	    }
	    if(jin == "discounts"){
			discountsDiv()
		}
		if(jin == "myDiscounts"){
			myDiscountsDiv()
		}
		if(jin == "ranking"){
			rankingDiv()
		}
		if(jin == "rankUser"){
			rankUserDiv()
		}

    }
	//优惠券页面
	function discountsDiv() {
		document.title = "优惠券分享"
		firstTimeKong()
		informationKong()
		$("#myselfss").css("display","block")
		$("#myDiv").css("display","none")
		$(".discountsDiv").css("display","block")
		$(".discounts").css("display","block")
		$(".discountsAdd").css("display","none")
		$(".vf_nav").css("display","none")
		var typeUrl = test.indexOf('&type=');
		if(test.slice(typeUrl+6,jin1) == "schoolDiscounts"){
			$(".discounts-head-right").removeClass("corder-wire")
			$(".discounts-head-left").addClass("corder-wire")
			$("#schoolDiscounts").css("display","block")
			$("#myDiscounts").css("display","none")
			schoolDiscountsAjax()
		}
		if(test.slice(typeUrl+6,jin1) == "myDiscounts"){
			$(".discounts-head-right").addClass("corder-wire")
			$(".discounts-head-left").removeClass("corder-wire")
			$("#schoolDiscounts").css("display","none")
			$("#myDiscounts").css("display","block")
			myDiscountsAjax()
		}
	}
	//获取驾校优惠券
	function schoolDiscountsAjax() {
		$.ajax({
			url:window.urls.url + "/coupon",
			type:"GET",
			contentType: "application/json",
			dataType:"json",
			success:function(res){
				console.log(res)
				if(res.data == ''){
					var div = ("<p style='text-align: center;padding: 15px 0'>暂无优惠券</p>")
					$(div).appendTo(".schoolDiscounts-z")
				}else{
					$.each(res.data,function (ind,el) {
						var imgUrl = ''
						var shopClass = ''
						var couponType = ''
						var couponTime = ''
						if(el.used == 1){
							shopClass = '所有商品可用'
						}
						if(el.used == 2){
							shopClass = '特定某类商品可用'
						}
						if(el.used == 3){
							shopClass = '指定商品可用'
						}

						if(el.valid_type == 1){
							couponTime = '领券后' + el.valid_days +'天到期'
						}
						if(el.valid_type == 2){
							couponTime =el.valid_start_time + ' -- ' + el.valid_end_time
						}

						if(el.type == 1){
							imgUrl = '__ROOT__ /AI_radar/image/poster/discounts1.png'
							couponType = '满'+ el.with_amount + '元减' + el.used_count + '元'
						}
						if(el.type == 2){
							imgUrl = '__ROOT__ /AI_radar/image/poster/discounts2.png'
							couponType = el.used_amount + '元优惠券'
						}
						if(el.type == 3){
							imgUrl = '__ROOT__ /AI_radar/image/poster/discounts4.png'
							couponType = el.describe
						}
						var couponNum = el.quota - el.take_count
						var div = ("<div class='schoolDiscounts-one' did='"+el.id+"'><img src='"+imgUrl+"' class='schoolDiscounts-img'><div class='schoolDiscounts-one-font'><div class='schoolDiscounts-top'><div class='schoolDiscounts-top-left'><p class='schoolDiscountsTitle overflow'>"+couponType+"</p><p class='schoolDiscountsName overflow'>"+el.name+"</p><p class='schoolDiscountsShop overflow'>"+shopClass+"</p><p class='schoolDiscountsShop overflow'>不可与其他优惠券叠加</p></div><div class='schoolDiscounts-top-right'><p class='schoolDiscounts-get'>已领：<span class='schoolDiscounts-get-num'>"+el.take_count+"</span></p><p class='schoolDiscounts-remain'>剩余：<span class='schoolDiscounts-remain-num'>"+couponNum+"</span></p><div class='schoolDiscounts-top-btn' did='"+el.id+"'>立即分享</div></div></div><div class='schoolDiscounts-bottom overflow'>"+couponTime+"</div></div></div>\n")
						$(div).appendTo(".schoolDiscounts-z")
					})
				}
				$(".CRM_log").css("display","none")

				schoolDiscountsDetails()
			},
			error:function(res){
				// console.log(res)
			}

		});
	}
	//获取教练优惠券
	function myDiscountsAjax() {
		$.ajax({
			url:window.urls.url + "/coupon/coach",
			type:"GET",
			contentType: "application/json",
			dataType:"json",
			success:function(res){
				// console.log(res)
				// console.log(res.data)
				if(res.data.length){
					$.each(res.data,function (ind,el) {
						var imgUrl = ''
						var typeNew = 0
						if(el.putaway == 1){
							imgUrl = '__ROOT__ /AI_radar/image/poster/hint1.png'
							typeNew = 1
						}
						if(el.putaway == 2){
							imgUrl = '__ROOT__ /AI_radar/image/poster/hint2.png'
							typeNew = 2
						}
						var couponNum = el.quota - el.take_count
						if(couponNum == 0){
							typeNew = 0
							imgUrl = '__ROOT__ /AI_radar/image/poster/hint3.png'
						}
						var mytime = el.valid_end_time
						var dateTmp = mytime.replace(/-/g,'/')   //为了兼容IOS，需先将字符串转换为'2018/9/11 9:11:23'
						var timestamp = Date.parse(dateTmp)
						console.log(timestamp)
						if(Date.parse(new Date()) > timestamp){
							typeNew = 0
							imgUrl = '__ROOT__ /AI_radar/image/poster/hint4.png'
						}
						var div = ("<div class='myDiscounts-one' did='"+el.id+"' putaway='"+typeNew+"'><div class='myDiscounts-right-image'><img src='"+imgUrl+"' class='myDiscounts-right-img"+el.id+"'></div> <img src='__ROOT__ /AI_radar/image/poster/discounts5.png' class='schoolDiscounts-img'><div class='schoolDiscounts-one-font'><div class='schoolDiscounts-top'><div class='schoolDiscounts-top-left'><p class='schoolDiscountsTitle overflow'>"+el.describe+"</p><p class='schoolDiscountsName overflow'>"+el.name+"</p><p class='schoolDiscountsShop overflow'>所有商品可用</p><p class='schoolDiscountsShop overflow'>不可与其他优惠券叠加</p></div><div class='schoolDiscounts-top-right'><p class='schoolDiscounts-get'>已领：<span class='schoolDiscounts-get-num'>"+el.take_count+"</span></p><p class='schoolDiscounts-remain'>剩余：<span class='schoolDiscounts-remain-num'>"+couponNum+"</span></p><div class='schoolDiscounts-top-btn' did='"+el.id+"'>立即分享</div></div></div><div class='schoolDiscounts-bottom overflow'>"+el.valid_end_time+"过期</div></div></div>\n")
						$(div).appendTo(".myDiscounts-z")
					})
				}else{
					var div = ("<p style='text-align: center;padding: 15px 0'>你还未创建优惠券，快去创建吧</p>")
					$(div).appendTo(".myDiscounts-z")
				}
				$(".CRM_log").css("display","none")

				myDiscountsDetails()
			},
			error:function(res){
				// console.log(res)
			}

		});
	}
	//个人优惠券操作
	function myDiscountsDetails(){
		$(".myDiscounts-one").each(function (ind,dom){
			dom.onclick = function () {
				if($(".myDiscounts-ones").length > 0){
					$(".myDiscounts-ones").each(function (a,b) {
						b.remove()
					})
				}
				console.log("gfhjasdfhjgj")
				if(dom.getAttribute("putaway") == 0){
					$(this).after("<div class='myDiscounts-ones'><div class='myDiscounts-ones-delete0'></div><div class='myDiscounts-ones-update' did='"+dom.getAttribute("did")+"'>获客详情</div></div>")
				}
				if(dom.getAttribute("putaway") == 1){
					$(this).after("<div class='myDiscounts-ones'><div class='myDiscounts-ones-delete' did='"+dom.getAttribute("did")+"' putaway='"+dom.getAttribute("putaway")+"' style='color:#1D901B'>开始发放</div><div class='myDiscounts-ones-update' did='"+dom.getAttribute("did")+"'>获客详情</div></div>")
				}
				if(dom.getAttribute("putaway") == 2){
					$(this).after("<div class='myDiscounts-ones'><div class='myDiscounts-ones-delete' did='"+dom.getAttribute("did")+"' putaway='"+dom.getAttribute("putaway")+"' style='color:red'>停止发放</div><div class='myDiscounts-ones-update' did='"+dom.getAttribute("did")+"'>获客详情</div></div>")
				}
				myAcquires()
				myDiscountsUpdata()
			}
		})
		schoolDiscountsClick()
		// $(".schoolDiscounts-top-btn").each(function (index,el) {
		// 	el.onclick = function () {
		// 		// window.location.href = "?id="+el.getAttribute('did')+"&type=share#myDiscounts"
		// 	}
		// })
	}
	//上下架教练优惠券
	function myDiscountsUpdata() {
		$(".myDiscounts-ones-delete").click(function () {
			$(".CRM_log").css("display","block")

			var types = ""
			var putawayId = $(this).attr("did")
			if($(this).attr("putaway") == 1){
				types = "up"
			}
			if($(this).attr("putaway") == 2){
				types = "down"
			}
			// myDiscountsUpdataAjax($(this).attr("did"))
			console.log(putawayId)
			$.ajax({
				url:window.urls.url + "/coupon/status",
				type:"POST",
				contentType: "application/json",
				dataType:"json",
				data:JSON.stringify({
					token:window.tokens.token_boss,
					product:putawayId,
					type:types
				}),
				success:function(res){
					console.log(res)
					if(res.data == "success"){
						if(types == "up"){
							$(".myDiscounts-ones-delete").html("停止发放")
							$(".myDiscounts-ones-delete").attr("putaway" ,"2")
							$(".myDiscounts-ones-delete").css("color","red")
							$(".myDiscounts-right-img" + putawayId).attr("src","__ROOT__ /AI_radar/image/poster/hint2.png")
						}
						if(types == "down"){
							$(".myDiscounts-ones-delete").html("开始发放")
							$(".myDiscounts-ones-delete").attr("putaway" ,"1")
							$(".myDiscounts-ones-delete").css("color","#1D901B")
							$(".myDiscounts-right-img" + putawayId).attr("src","__ROOT__ /AI_radar/image/poster/hint1.png")
						}
					}
					$(".CRM_log").css("display","none")

				},
				error:function(res){
					console.log(res)
				}
			})
		})
	}

	//驾校优惠券操作
	function schoolDiscountsDetails() {
		$(".schoolDiscounts-one").each(function (ind,dom) {
			dom.onclick = function () {
				if($(".schoolDiscounts-ones").length > 0){
					$(".schoolDiscounts-ones").each(function (a,b) {
						b.remove()
					})
				}
				$(this).after("<div class='schoolDiscounts-ones'><div class='schoolDiscounts-ones-delete'></div><div class='myDiscounts-ones-update' did='"+dom.getAttribute("did")+"'>获客详情</div></div>")
				myAcquires()
			}
		})
		schoolDiscountsClick()
		// $(".schoolDiscounts-top-btn").each(function (index,el) {
		// 	el.onclick = function () {
		// 		// window.location.href = "?id="+el.getAttribute('did')+"&type=share#myDiscounts"
		// 	}
		// })
	}
	//分享优惠券
	function schoolDiscountsClick() {
		$(".schoolDiscounts-top-btn").each(function (index,el) {
			el.onclick = function () {
				window.location.href = "?id="+el.getAttribute('did')+"&type=share#myDiscounts"
			}
		})
	}
	//优惠券获客详情的人
	function myAcquires(){
		$(".myDiscounts-ones-update").click(function () {
			$(".CRM_log").css("display","block")

			// console.log($(this).attr("did"))
			myAcquiresAjax($(this).attr("did"))
			$(".discountsAcquire").css("display","block")
		})
	}
	//获取优惠券获客详情的人
	function myAcquiresAjax(id) {
		$.ajax({
			url:window.urls.url + "/coupon/people/" + id,
			type:"get",
			contentType: "application/json",
			dataType:"json",
			success:function(res){
				console.log(res)
				$(".CRM_log").css("display","none")

			},
			error:function(res){
				console.log(res)
			}
		})
	}
	//打开创建优惠券
	function myDiscountsDiv() {
		firstTimeKong();
		informationKong();
		$(".CRM_log").css("display","none");
		$("#myselfss").css("display","block");
		$("#myDiv").css("display","none");
		$(".discountsDiv").css("display","block");
		$(".vf_nav").css("display","none");
		$(".discounts").css("display","none");
		var typeUrl = test.indexOf('&type=');
		if(test.slice(typeUrl+6,jin1) == "add"){
			document.title = "创建优惠券";
			$(".discountsAdd").css("display","block");
			$(".discountsShare").css("display","none");
		}
		if(test.slice(typeUrl+6,jin1) == "share"){
			document.title = "分享优惠券";
			$(".CRM_schedule").css("display","block");
			$(".discountsAdd").css("display","none");
			$(".discountsShare").css("display","block");
			var rankUserUrl = test.indexOf('?id=');
			detailsAcquireAjax(test.slice(rankUserUrl+4,typeUrl))//优惠券详情
			postersInfoAjax(test.slice(rankUserUrl+4,typeUrl))//优惠券二维码
			// shareCreate()

		}
	}
	//获取优惠券详情
	function detailsAcquireAjax(id) {
		// console.log(id)
		$.ajax({
			url:window.urls.url + "/coupon/details/" + id,
			type:"get",
			contentType: "application/json",
			dataType:"json",
			success:function(res){
				// console.log(res)

				var coupon1=''//优惠券类别
				var coupon3=''//优惠券形式
				if(res.data.type == 2){
					coupon1 = '定额券'
					coupon3 = res.data.used_amount + '元优惠券'
				}
				if(res.data.type == 1){
					coupon1 = '满减券'
					coupon3 = '满' + res.data.with_amount + '元减' + res.data.used_amount
				}
				if(res.data.type == 3 || res.data.type == 4){
					coupon1 = '特定券'
					coupon3 = res.data.describe
				}

				$(".discounts-div-left").html(coupon1)
				$(".discounts-p1").html(res.data.name)
				$(".discounts-p2").html(coupon3)
				$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 15)
				shareCreate()

			},
			error:function(res){
				console.log(res)
			}
		})
	}
	//优惠券生成图片
	function shareCreate() {
		if($(".img-fabrication-font-num").html() >= 65){
			// console.log("开始生成")
			jQuery(document).ready(function(){
				var dom=$(".discountsShare-image"); //你要转变的dom
				var width = dom.width();
				var height = dom.height();
				var type = "png";
				var scaleBy = 3;  //缩放比例
				var canvas = document.createElement('canvas');
				var rect = dom.get(0).getBoundingClientRect();
				canvas.width = width * scaleBy;
				canvas.height = height * scaleBy;  //35是我处理完后发现短了一点，具体为什么不清楚,如果你也少的话，根据自己的项目调吧
				canvas.style.width = width * scaleBy + 'px';
				canvas.style.height = height * scaleBy + 'px';
				var context = canvas.getContext('2d');
				context.scale(scaleBy, scaleBy);
				context.translate(-rect.left,-rect.top);
				// 【重要】关闭抗锯齿
				context.mozImageSmoothingEnabled = false;
				context.webkitImageSmoothingEnabled = false;
				context.msImageSmoothingEnabled = false;
				context.imageSmoothingEnabled = false;

				var img = new Image();
				//此处图像默认放置占位，必须真实有效存在
				setTimeout(function(){
					img.src='https://business.17jxyx.com/AI_radar/image/my/images.jpg';
					img.onload = function(){
						var elem = jQuery('.discountsShare-image');
						html2canvas([elem.get(0)], {
							canvas:canvas,
							onrendered: function (canvas) {
								var image = canvas.toDataURL("image/png");
								// console.log(image)
								var timetamp = Date.parse(new Date())
								// var filename = 'poster'+timetamp+".jpg";

								// console.log(res.data.id)
								// dataURLtoFile(image,filename,res.data.id)

								var pHtml = "<img src='"+image+"' style='width:100%;height:auto'>";
								$(".discountsShare-image").css("display",'none')
								$('.discountsShare-image').html("");
								$(".discountsShare-images").css("display","block")
								jQuery(".discountsShare-images").html(pHtml);
								$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 45)
								$(".CRM_schedule").css("display",'none')
								// $(".CRM_log").css("display","none")
								// jQuery("#content").attr("style","padding-top:40px");
								// $("#content").append(Canvas2Image.convertToImage(canvas,width* scaleBy,height* scaleBy,type));//这是放大了很3倍的图片
								// $("#content img").css("width",width+"px").css("height",height+"px");//
							}
						});
					}
				},1000)
			});
			setTimeout(function(){
				$(".motivationalbtn").css("display","none")
				$(".motivationalImages").css("display","block")

			},1000)
		}

	}

	//优惠券获取个人信息
	function postersInfoAjax(did){
		// $(".CRM_schedule").css("display",'none')

		$.ajax({
			url:window.urls.url + "/my/oneself/info",
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				token:window.tokens.token_boss,
			}),
			success:function(res){
				// console.log(res.data)
				$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 10)

				if(res.data){
					if(res.data.userimg){
						// if(localStorage.getItem("headImg")){
						// 	alert("yixiazai 下载")
						//
						// 	$(".discountsShare-head-img").attr("src",JSON.parse(localStorage.getItem("headImg")).url)
						// 	$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 20)
						// 	shareCreate()
						// 	// document.querySelector(".userHead").src = JSON.parse(localStorage.getItem("headImg")).url
						// }else{
						// 	alert(res.data.userimg.url)

							getBase642(res.data.userimg.url)
									.then(function(base64){
										// var obj = {
										// 	id:res.data.thirdapp.img.id,
										// 	url:base64
										// }
										// localStorage.setItem("headImg",JSON.stringify(obj))
										// alert("下载")
										$(".discountsShare-head-img").attr("src",base64)
										$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 20)
										shareCreate()
										// document.querySelector(".userHead").src = base64
										// console.log(base64);//处理成功打印在控制台
									},function(err){
										console.log(err);//打印异常信息
									});
						}
					}
					$(".discountsShare-name").html(res.data.name)
					$(".discountsShare-company").html(res.data.thirdapp.sub_name)
				// }
			},
			error:function(res){
				console.log(res)
			}
		})
		$.ajax({
			url:window.urls.url + "/coupon/couponqrcode",
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				token:window.tokens.token_boss,
				c_id:did,
				page:'pages/index/index'
			}),
			success:function(res){
				if(res.data){
					getBase64(res.data.key)
							.then(function(base64){
								$(".discountsShare-qrcode-img").attr("src",base64)
								$(".img-fabrication-font-num").html(parseInt($(".img-fabrication-font-num").html()) + 25)
								shareCreate()
							},function(err){
								console.log(err);//打印异常信息
							});
				}
			},
			error:function(res){
				$(".discountsShare-images-font").html(res.responseText)
				console.log(res)
			}
		})
	}
	//传入图片路径，返回base64
	function getBase64(img){
		function getBase64Image(img,width,height) {
			//width、height调用时传入具体像素值，控制大小 ,不传则默认图像大小
			var canvas = document.querySelector(".canvas");
			canvas.width = width ? width : img.width;
			canvas.height = height ? height : img.height;


			var ctx = canvas.getContext("2d");
			ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
			var dataURL = canvas.toDataURL();
			return dataURL;
		}
		var image = new Image();
		image.crossOrigin = '';
		image.src = img;
		var deferred=$.Deferred();
		if(img){
			image.onload =function (){
				deferred.resolve(getBase64Image(image));//将base64传给done上传处理
			}
			return deferred.promise();//问题要让onload完成后再return sessionStorage['imgTest']
		}
	}
	//传入图片路径，返回base64
	function getBase642(img){
		function getBase64Image(img,width,height) {
			//width、height调用时传入具体像素值，控制大小 ,不传则默认图像大小
			var canvas = document.querySelector(".canvas2");
			canvas.width = width ? width : img.width;
			canvas.height = height ? height : img.height;


			var ctx = canvas.getContext("2d");
			ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
			var dataURL = canvas.toDataURL();
			return dataURL;
		}
		var image = new Image();
		image.crossOrigin = '';
		image.src = img;
		var deferred=$.Deferred();
		if(img){
			image.onload =function (){
				deferred.resolve(getBase64Image(image));//将base64传给done上传处理
			}
			return deferred.promise();//问题要让onload完成后再return sessionStorage['imgTest']
		}
	}
	//排行榜
	function rankingDiv() {
		firstTimeKong()
		informationKong()
		$(".rankUser").css("display","none")
		$(".ranking").css("display","block")
		$(".rank-time").css("display","block")
		$(".vf_nav").css("display","none")
		var typeUrl = test.indexOf('?id=');
		rankPage = 1
		rankingAjax(rankPage,sizeRen,test.slice(typeUrl+4,jin1))
		myRankAjax(test.slice(typeUrl+4,jin1))
	}
	//查看给我点赞的人
	function rankUserDiv() {
		document.title = "赞我的人";
		$(".CRM_log").css("display","none")
		firstTimeKong();
		informationKong();
		$(".ranking").css("display","block")
		$(".rank-time").css("display","none")
		$(".vf_nav").css("display","none")
		$(".rankUser").css("display","block")
		var typeUrl = test.indexOf('?id=');
		rankUserPage = 1
		rankUserAjax(test.slice(typeUrl+4,jin1),rankUserPage,sizeRen)
	}
	//获取每日排行
	function rankingAjax(page,size,time) {
	    $(".rank-top-time").html(time)
		$.ajax({
			url:window.urls.url + "/behavior/rank",
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				token:window.tokens.token_boss,
				time:time,
				page:page,
				size:size,
			}),
			success:function(res){
				// console.log(res.data.data)
				// console.log(res)
				if(res.data.data.length > 0){
					$.each(res.data.data,function (index,el) {
						if(el.rank == 1){
							$(".rank-img-one").attr("src",el.work_user_info.userimg.url)
							$(".rank-top-name").html(el.work_user_info.name)
						}
						var rankColor = "#ccc"
						if(el.thumbsup.length < 1){
							rankColor = "#ccc"
						}else{
							rankColor = "red"
						}
						var rankdiv = ("<div class='rank-oneselfs'><div class='rank-one1 overflow'>"+el.rank+"</div><div class='rank-one2'><div class='rank-imgOne2'><img src='"+el.work_user_info.userimg.url+"'></div></div><div class='rank-one3'><div class='rank-nameOn3 overflow'>"+el.work_user_info.name+"</div><div class='rank-zhiOne3 overflow'>"+el.work_user_info.position+"</div></div><div class='rank-one4'></div><div class='rank-one5'><div class='rank-numOne5 overflow'>"+el.user_num+"</div><div class='rank-zhiOne5 overflow'>当日客户数</div></div><div class='rank-one6 rank-praise' did='"+el.id+"'><div class='rank-numOne6 overflow'>"+el.thumbsup_count+"</div><div class='rank-zhiOne6'><div class='rank-imgOne6'><i class='iconfont icon-xin icon-xin-color' style='color:"+rankColor+"'></i></div></div></div></div>")
						$(rankdiv).appendTo(".rank-allOne")

					})
					rankPraise()
					rankJudge = 1
					if(res.data.data.length < size){
						rankJudge = 0
						$(".rank-alls-p").html("没有更多了")
					}
				}else{
					rankJudge = 0
					$(".rank-alls-p").html("没有更多了")
				}
			},
			error:function(res){
				// console.log(res)
			}
		});

	}
	//排行榜点赞
	function rankPraise() {
		// console.log($(".rank-praise"))
		$(".rank-praise").each(function(a,b){
			b.onclick = function(){
				// console.log(b.getAttribute("did"))
				// console.log($(this).find(".icon-xin-color").css("color"))
				if($(this).find(".icon-xin-color").css("color") == "rgb(204, 204, 204)"){
					console.log($(this).find(".rank-numOne6").html())
					console.log(parseInt($(this).find(".rank-numOne6").html()))

					var rank_nums = parseInt($(this).find(".rank-numOne6").html()) + 1
					console.log(rank_nums)
					$(this).find(".rank-numOne6").html(rank_nums)
					praiseAjax(b.getAttribute("did"))
				}else{
					alert("你已经点过赞了")
				}

				$(this).find(".icon-xin-color").css("color","red")
			}
		})
	}
	//点赞
	function praiseAjax(userid) {
		// console.log(userid)
		$.ajax({
			url:window.urls.url + "/behavior/thumbsup",
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				token:window.tokens.token_boss,
				id:userid
			}),
			success:function(res){
				// console.log(res)
			},
			error:function(res){
				// console.log(res)
			}

		});
	}
	//获取我的排名
	function myRankAjax(time) {
		$.ajax({
			url:window.urls.url + "/behavior/my/rank",
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				token:window.tokens.token_boss,
				time:time,
			}),
			success:function(res){
				// console.log(res);
				if(res.data.rank == 1){
					$(".rank-top-p2").html("成功登顶，继续保持")
				}else{
					$(".rank-top-p2").html("努力超越他，明天就是你")
				}
				if(res.data.rank < 4){
					$(".rank-one4-img").css("display",'block')
				}
				$(".rank-img-my").attr("src",res.data.work_user.userimg.url)
				$(".rank-rank-my").html(res.data.rank)
				$(".rank-name-my").html(res.data.work_user.name)
				$(".rank-position-my").html(res.data.work_user.position)
				$(".rank-user-my").html(res.data.user_num)
				$(".rank-num-my").html(res.data.thumbsup_count)
				$(".rank-my-users").attr("did",res.data.id)
				$(".CRM_log").css("display","none")
			},
			error:function(res){
				// console.log(res)
			}
		});
	}
	//获取赞我的人
	function rankUserAjax(myId,page,size) {
		console.log(myId,page,size)
		$.ajax({
			url:window.urls.url + "/behavior/thumbsup/list/" + myId,
			type:"POST",
			contentType: "application/json",
			dataType:"json",
			data:JSON.stringify({
				// token:window.tokens.token_boss,
				page:page,
				size:size,
			}),
			success:function(res){
				// console.log(res)
				if(res.data.data.length > 0){
					$.each(res.data.data,function (index,el) {
						var div = ("<div class='rankUser-one'><div class='rankUser-ongImg'><img src='"+el.work_user.userimg.url+"'> </div> <div class='rankUser-oneName overflow'>"+el.work_user.name+"</div> </div>")
						$(div).appendTo(".rankUser-time")
					})
					rankUserJudge = 1
					if(res.data.data.length < size){
						rankJudge = 0
						$(".rankUser-more").html("没有更多了")
					}
				}else{
					rankJudge = 0
					$(".rankUser-more").html("没有更多了")
				}
			},
			error:function(res){
				// console.log(res)
			}
		});
	}
	//通讯录
    function peoperAjax(names){
    	// $("#books").animate({scrollTop:0},10)
    	// $("body").animate({scrollTop:0},10)
    	document.querySelector(".book").scrollTop = 0
    	document.querySelector("#books").scrollTop = 0
    	document.querySelector("body").scrollTop = 0



    	var bookXuan = document.querySelectorAll(".bookXuan");
		// Array.from(bookXuan).forEach(function(dom,index){
				Array.from(bookXuan).forEach(function(doma,indexa){
					doma.classList.remove("colorBook");
				})
				$(".activity").remove();
				document.querySelector("#"+names).classList.add("colorBook");
		// })
		// console.log(names);
 		$.ajax({
		    url:window.urls.url + "/book/list",
		    type:"POST",
		    contentType: "application/json",
		    dataType:"json",
		    data:JSON.stringify({
		      token:window.tokens.token_boss,
		      type:names
		    }),
		    success:function(res){
		    	$(".CRM_log").css("display","none")
		      // console.log(res.data);
		      // console.log(res);
		      if($(".bookPeo").length>0){
		      	$(".bookPeo").each(function(ind,el){
		      		el.remove();
		      	})

		      }
		      var span;
		      if(res.data){
		      	if(names == "activity"){
		      		$(".huo").html(res.data.length)
		      		$(".huoS").css("display","inline-block")
		      		$(".genS").css("display","none")
		      		$(".chengS").css("display","none")
		      	}
		      	if(names == "follow"){
		      		$(".gen").html(res.data.length)
		      		$(".genS").css("display","inline-block")
		      		$(".huoS").css("display","none")
		      		$(".chengS").css("display","none")
		      	}
		      	if(names == "rate"){
		      		$(".cheng").html(res.data.length)
		      		$(".chengS").css("display","inline-block")
		      		$(".huoS").css("display","none")
		      		$(".genS").css("display","none")
		      		if(document.querySelector(".bookPeosZ")){
		      			document.querySelector(".bookPeosZ").remove()
		      		}
		      		var divs = $("<div class='bookPeosZ'><div class='bookPeos1' cid='1'><div class='bookPeosL'>80%-100%(<span class='bookPeosa1'>0</span>)</div><div class='bookPeosR'><i class='iconfont icon-jiantousanjiaoxia' id='xiaFont12'></i><i class='iconfont icon-jiantou'  id='xiaFont11'></i></div></div><div class='bookPeoss1'></div><div class='bookPeos2' cid='2'><div class='bookPeosL'>50%-80%(<span class='bookPeosa2'>0</span>)</div><div class='bookPeosR'><i class='iconfont icon-jiantousanjiaoxia' id='xiaFont22'></i><i class='iconfont icon-jiantou'  id='xiaFont21'></i></div></div><div class='bookPeoss2'></div><div class='bookPeos3' cid='3'><div class='bookPeosL'>0%-50%(<span class='bookPeosa3'>0</span>)</div><div class='bookPeosR'><i class='iconfont icon-jiantousanjiaoxia' id='xiaFont32'></i><i class='iconfont icon-jiantou'  id='xiaFont31'></i></div></div><div class='bookPeoss3'></div></div>");
				    $(divs).appendTo(".bookCenterB");
		      	}
		      	// console.log(res.data)
		      	res.data.forEach(function(dom,index){
		      		if(names == "rate"){
		      			if(dom.user.nickname){
			      			if(dom.rate>=80){
			      				var div = $("<div class='one bookPeo' cid='"+dom.user.id+"'><div class='ongImg'><img src='"+dom.user.avatar_url+"'></div><div class='oneName' >"+dom.user.nickname+"</div></div>");
				      			$(div).appendTo(".bookPeoss1");
			      			}
			      			if(dom.rate>=50 && dom.rate<80){
			      				var div = $("<div class='one bookPeo' cid='"+dom.user.id+"'><div class='ongImg'><img src='"+dom.user.avatar_url+"'></div><div class='oneName' >"+dom.user.nickname+"</div></div>");
				      			$(div).appendTo(".bookPeoss2");
			      			}
			      			if(dom.rate>=0 && dom.rate<50){
			      				var div = $("<div class='one bookPeo' cid='"+dom.user.id+"'><div class='ongImg'><img src='"+dom.user.avatar_url+"'></div><div class='oneName' >"+dom.user.nickname+"</div></div>");
				      			$(div).appendTo(".bookPeoss3");
			      			}
		      			}
		      		}
		      		if(names == "activity"){
		      			if(dom.user_info.nickname){
			      			var div = $("<div class='one bookPeo' cid='"+dom.user_info.id+"'><div class='ongImg'><img src='"+dom.user_info.avatar_url+"'></div><div class='activityoneName' >"+dom.user_info.nickname+"</div><div class='activityoneTi'><div class='activityoneTiT'>最后活动</div><div class='activityoneTiB'>"+dom.time+"</div></div></div>");
			      			$(div).appendTo(".bookCenterB");
			      		}
		      		}
		      		if(names == "follow"){
		      			if(dom.user){
				      		if(dom.user.nickname){
				      			var div = $("<div class='one bookPeo' cid='"+dom.user.id+"'><div class='ongImg'><img src='"+dom.user.avatar_url+"'></div><div class='activityoneName' >"+dom.user.nickname+"</div><div class='activityoneTi'><div class='activityoneTiT'>最后活动</div><div class='activityoneTiB'>"+dom.time+"</div></div></div>");
				      			// var div = $("<div class='one bookPeo' cid='"+dom.user.id+"'><div class='ongImg'><img src='"+dom.user.avatar_url+"'></div><div class='oneName' >"+dom.user.nickname+"</div></div>");
				      			$(div).appendTo(".bookCenterB");
				      		}
		      			}
		      		}
		      	})
		      	if(document.querySelector(".bookPeoss1")){
			      	$(".bookPeosa1").html(document.querySelector(".bookPeoss1").childNodes.length)
			      	$(".bookPeosa2").html(document.querySelector(".bookPeoss2").childNodes.length)
			      	$(".bookPeosa3").html(document.querySelector(".bookPeoss3").childNodes.length)
			      	$("#xiaFont11").css("display","none")
			      	$("#xiaFont21").css("display","none")
			      	$("#xiaFont31").css("display","none")
			      	if(document.querySelector(".bookPeoss1").childNodes.length == 0){
			      		var div = $("<div class='one bookPeo' style='text-align: center;display:block'>暂无学员</div>");
			      		$(div).appendTo(".bookPeoss1");
			      	}
			      	if(document.querySelector(".bookPeoss2").childNodes.length == 0){
			      		var div = $("<div class='one bookPeo' style='text-align: center;display:block'>暂无学员</div>");
			      		$(div).appendTo(".bookPeoss2");
			      	}
			      	if(document.querySelector(".bookPeoss3").childNodes.length == 0){
			      		var div = $("<div class='one bookPeo' style='text-align: center;display:block'>暂无学员</div>");
			      		$(div).appendTo(".bookPeoss3");
			      	}
		      	}
		      	var bookPeos1p = true;
		      	var bookPeos2p = true;
		      	var bookPeos3p = true;
		      	$(".bookPeos1").click(function(){
		      		if(bookPeos1p){
		      			bookPeos1p = false
			      		$(".bookPeoss1").css("display","block")
			      		$(".bookPeoss2").css("display","none")
			      		$(".bookPeoss3").css("display","none")
			      		$("#xiaFont11").css("display","inline-block")
			      		$("#xiaFont12").css("display","none")
		      		}else{
		      			bookPeos1p = true
		      			$(".bookPeoss1").css("display","none")
		      			$("#xiaFont12").css("display","inline-block")
			      		$("#xiaFont11").css("display","none")
		      		}
		      	})
		      	$(".bookPeos2").click(function(){
		      		if(bookPeos2p){
		      			bookPeos2p = false
			      		$(".bookPeoss2").css("display","block")
			      		$(".bookPeoss1").css("display","none")
			      		$(".bookPeoss3").css("display","none")
			      		$("#xiaFont21").css("display","inline-block")
			      		$("#xiaFont22").css("display","none")
			      	}else{
		      			bookPeos2p = true
		      			$(".bookPeoss2").css("display","none")
		      			$("#xiaFont22").css("display","inline-block")
			      		$("#xiaFont21").css("display","none")
		      		}
		      	})
		      	$(".bookPeos3").click(function(){
		      		if(bookPeos3p){
		      			bookPeos3p = false
			      		$(".bookPeoss3").css("display","block")
			      		$(".bookPeoss1").css("display","none")
			      		$(".bookPeoss2").css("display","none")
			      		$("#xiaFont31").css("display","inline-block")
			      		$("#xiaFont32").css("display","none")
			      	}else{
		      			bookPeos3p = true
		      			$(".bookPeoss3").css("display","none")
		      			$("#xiaFont32").css("display","inline-block")
			      		$("#xiaFont31").css("display","none")
		      		}
		      	})

		      }else{
		      	// span = $("<span class='activity'> (0)</span>");
		      	var div = $("<div class='one bookPeo' style='text-align: center;display:block'>暂无学员</div>");

		      	$(div).appendTo(".bookCenterB");
		      }
		      // $(span).appendTo(".colorBook");
		      var bookPeo = document.querySelectorAll(".bookPeo");
		      goto(bookPeo);

		    },
		    error:function(res){
		      console.log(res);
		      $(".CRM_log").css("display","none")
		      // alert("请求数据失败")
		    }
		})
 	}
    footerPage(jin,indexFirstTimeNum,i)
    function firstTimeKong(){
    	$(".firstTime").children().each(function(ind,dom){
    		dom.remove()
    	})
    }
    function centerPeoperKong(){
    	$(".centerPeoperss").children().each(function(inds,doms){
    		doms.remove()
    	})
    }
    function informationKong(){
    	$(".missionZ").children().each(function(indss,domss){
    		domss.remove()
    	})
    }
    //请求消息列表，存入缓存
    // console.log(localStorage.getItem("judge"))

    	chatAjax()
    // console.log(localStorage.getItem("MESSAGE:UID:1"))
	//获取聊天记录
    function chatAjax(){
	    $.ajax({
		    url:window.urls.url + "/message/user",
		    type:"POST",
		    contentType: "application/json",
			dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	// corpid:localStorage.getItem("CRM_corpId")
		    }),
		    success:function(res){
		        // console.log(res.data)
				// console.log(res);
				var chatNums = 0
				var arrObj = []
				if(res.data != ''){
					informationKong()
					message_one(res.data)
					$.each(res.data, function(index, el) {
						// console.log(el.unread)
						var dateTmp = el.time
		    			var newTimes = dateTmp.slice(0,16)
			        	var objs = {}
			        	objs.uid = el.uid;
					    objs.message_type = el.message_type;
					    objs.head_img = el.head_img;
					    objs.user_name = el.user_name;
					    objs.content = el.content;
					    objs.time = newTimes;
					    objs.unread = el.unread
					    arrObj.push(objs)
			      		chatNums = chatNums + el.unread
		// 		      	// insertMessage(el)
			        })
				}else{
					$(".missionCen").css("display","block")
				}
		        // insertMessage2(arrObj)
				//     		console.log("返回2124")
		        localStorage.setItem('MESSAGE',JSON.stringify(arrObj));
		        console.log(chatNums)
		        if(chatNums > 99){
		      		chatNums = 99
		        }
		        if(chatNums == 0 || res.data == ''){
		      		$(".read").css("display","none")
		        }else{
		        	$(".read").css("display","block")
		        }
		        $(".read").html(chatNums)
		      // informations()
		    },
		    error:function(res){
		      // console.log(res)
		    }
		});
    }

	window.onhashchange = function(){
        var hash = location.hash;
        var name = hash.substring(1,hash.length);
        jin = name
        footerPage(jin,indexFirstTimeNum,i)
    }
    var scrollTopPan = true;

	//获取行为记录
    function indexFirstTime(indexFirstTimeNums,is){
    	// console.log(indexFirstTimeNums,is)

    	$.ajax({
		    url:window.urls.url + "/behavior/list",
		    type:"POST",
		    contentType: "application/json",
    		dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	page:indexFirstTimeNums,
		    	// corpid:localStorage.getItem("CRM_corpId")
		    	// i:is
		    }),
		    success:function(res){
		    	// console.log(res)
		    	$(".CRM_log").css("display","none")
		    	// console.log(res.data)
		    	// console.log("正确")
		    	if(res.data.length>0){
		    		// console.log(res.data)

		    		$.each(res.data, function(index, el) {
		    		// if($(".firstTime").length != 0){
		    			var fontdetails = ''
		    			if(el.type == 1){
		    				fontdetails = "第"+ el.times +"次进入商城，问问TA对哪个班型感兴趣吧"
		    			}
		    			if(el.type == 2){
		    				fontdetails = "第"+ el.times +"次查看驾校官网，看来对驾校设施、服务比较满意"
		    			}
		    			if(el.type == 3){
		    				fontdetails = "第"+ el.times +"次复制了你的微信，记得及时和他沟通"
		    			}
		    			if(el.type == 4){
		    				fontdetails = "第"+ el.times +"次转发了你的名片，邀约TA和朋友一起来学车吧"
		    			}
		    			if(el.type == 5){
		    				fontdetails = "第"+ el.times +"次关注你，赶紧和他联系吧"
		    			}
		    			if(el.type == 6){
		    				fontdetails = "第"+ el.times +"次咨询"+el.content+"重点和他介绍一下此班型吧"
		    			}
		    			if(el.type == 7){
		    				fontdetails = "第"+ el.times +"次保存了你的电话，有学车意向，记得持续沟通"
		    			}
		    			if(el.type == 8){
		    				fontdetails = "TA已经给你点赞了，对你印象不错"
		    			}
		    			if(el.type == 9){
		    				fontdetails = "第"+ el.times +"次拨打了你的电话，学车意向浓厚"
		    			}
		    			if(el.type == 10){
		    				fontdetails = "第"+ el.times +"次播放了你的语音，看来对你个人比价感兴趣"
		    			}
		    			if(el.type == 12){
		    				fontdetails = "第"+ el.times +"次复制了你的公司，看来对驾校比较满意"
		    			}
		    			if(el.type == 13){
		    				fontdetails = "第"+ el.times +"次复制了你的地址，邀约TA来驾校实地考察吧"
		    			}
		    			if(el.type == 14){
		    				fontdetails = "第"+ el.times +"次领取了优惠券，学车意向浓厚，立即沟通"
		    			}
		    			if(el.type == 15){
		    				fontdetails = "第"+ el.times +"次参与了拼团，赶紧和他联系吧"
		    			}
		    			if(el.type == 16){
		    				fontdetails = "第"+ el.times +"次查看了"+el.content+"看来对这个班型比较感兴趣"
		    			}
		    			if(el.type == 17){
		    				fontdetails = "第"+ el.times +"次添加"+el.content+"到购物车，成功在望"
		    			}
		    			if(el.type == 18){
		    				fontdetails = "第"+ el.times +"次分享了"+el.content+"邀约TA和朋友一起来学车吧"
		    			}
		    			if(el.type == 19){
		    				fontdetails = "第"+ el.times +"次查看了你的图片，已成功吸引TA的关注"
		    			}
		    			if(el.type == 20){
		    				fontdetails = "第"+ el.times +"次查看了"+el.content+"资料，报名在望"
		    			}
		    			if(el.type == 21){
		    				fontdetails = "第"+ el.times +"次查看驾校官网图片，看来对驾校设施、服务比较在意"
		    			}
		    			if(el.type == 22){
		    				fontdetails = "第"+ el.times +"次播放了你的视频，看来有学车意向"
		    			}
		    			if(el.type == 23){
		    				fontdetails = "第"+ el.times +"次查看了"+el.content+"视频，报名在即"
		    			}
		    			if(el.type == 24){
		    				fontdetails = "第"+ el.times +"次查看了驾校官网视频，看来对驾校设施、服务比较在意"
		    			}
		    			if(el.type == 25){
		    				fontdetails = "第"+ el.times +"次分享了驾校官网，邀约TA和朋友来驾校实地考察吧"
		    			}
		    			if(el.type == 27){
		    				fontdetails = "TA最在意"+ el.content +"，沟通时注意这点哟"
		    			}
		    			if(el.type == 28){
		    				fontdetails = "已经向你授权TA的手机号码，已为你自动保存在TA的个人资料中"
		    			}
		    			// var dateTmp = el.time
		    			// var newTimes = dateTmp.slice(0,16)
		    			// console.log(dateTmp,newTimes)

						var newTimes = ''
						var dateTmp = el.year
		    			var newTimes2 = dateTmp.slice(0,10)
		    			var newTimes3 = dateTmp.slice(11)
		    			var newTimes4 = dateTmp.slice(0,10) + "-" + dateTmp.slice(11)
		    			// var newTimes5 = newTimes4.slice(0,13) + "-" + newTimes4.slice(14)
		    			var newTimes5 = el.stamp
		    			// console.log(newTimes5)
		    			// if(el.nickname){
			    			var years = el.year
			    			if($(".divDays").length == 0){
								var divTimess

								var divDay = $("<div class='divDays divDays"+newTimes5+"'><p class='divDaysP'>"+el.year+"</p><div class='divDaysN'></div</div>")
						    	$(divDay).appendTo(".firstTime")
								if(el.type == 50){
									divTimess = $("<div class='time'><div class='timeY' did='"+JSON.parse(el.content).time_info+"'><p class='timeY-p'>"+JSON.parse(el.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+el.url+"' class='imgL'></div><div class='timeYBC'>"+el.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>")

								}else{
									divTimess = $("<div class='divTime'><div class='divTimeL' did='"+el.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+el.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+el.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+fontdetails+"</div></div><div class='divTimeR' did='"+el.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
								}
						    		// console.log(el,$(".divDaysP")[$(".divDaysP").length-1].innerHTML,el.year,index,"if",$(".divDays").length-1)

							    $(divTimess).appendTo(".divDays")
						    }else{
						    	if($(".divDaysP")[$(".divDaysP").length-1].innerHTML == el.year){
									var divTimess2
									if(el.type == 50){
										divTimess2 = $("<div class='time'><div class='timeY' did='"+JSON.parse(el.content).time_info+"'><p class='timeY-p' >"+JSON.parse(el.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+el.url+"' class='imgL'></div><div class='timeYBC'>"+el.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>")

									}else{
										divTimess2 = $("<div class='divTime'><div class='divTimeL' did='"+el.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+el.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+el.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+fontdetails+"</div></div><div class='divTimeR' did='"+el.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
									}
				    				$(divTimess2).appendTo(".divDays"+newTimes5)
						    	}else{
									var divTimess3
						    		var divDay2 = "<div class='divDays divDays"+newTimes5+"'><p class='divDaysP'>"+el.year+"</p><div class='divDaysN'></div</div>"
						    			$(divDay2).appendTo(".firstTime")
									if(el.type == 50){
										divTimess3 = $("<div class='time'><div class='timeY' did='"+JSON.parse(el.content).time_info+"'><p class='timeY-p'>"+JSON.parse(el.content).time_info+" 排行榜</p><div class='timeYT'><div class='timeYTL'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).rank+"</p><p class='timeJ'>名次</p></div><div class='timeYTC'></div><div class='timeYTR'><div class='timeK'></div><p class='shu'>"+JSON.parse(el.content).user_num+"</p><p class='timeJ'>当日客户数</p></div></div><div class='timeYB'><div class='timeYBL'><img src='"+el.url+"' class='imgL'></div><div class='timeYBC'>"+el.nickname+"</div><div class='timeYBR'><i class='iconfont icon-arrow-right-copy'></i></div></div></div></div>")
									}else{
										divTimess3 = $("<div class='divTime'><div class='divTimeL' did='"+el.id+"'><div class='divTimeLT'><div class='divTimeImg'><img src='"+el.url+"'></div><div class='divTimeName'><span class='divTimeNames'>"+el.nickname+"</span><span class='divTimetime'>"+newTimes+"</span></div></div><div class='divTimeLB'>"+fontdetails+"</div></div><div class='divTimeR' did='"+el.id+"'><i class='iconfont icon-xiaoxi' id='tuandel1'></i></div></div>")
									}
						    		// console.log(el,$(".divDaysP")[$(".divDaysP").length-1].innerHTML,el.year,index,"if",$(".divDays").length-1)

							    	$(divTimess3).appendTo(".divDays"+newTimes5)
						    	}
						    }

		    			// }
		    		})
					centerTimeJudge = 1
		    	}else{
					centerTimeJudge = 0
		    		$(".loaderIndex").html("没有更多数据了")
		    	}
		    	if(res.data.length<10){
					centerTimeJudge = 0
		    		$(".loaderIndex").html("没有更多数据了")
		    	}

		    	var divTimeR = document.querySelectorAll(".divTimeR")
		    	immediately(divTimeR)
		    	var divTimeL = document.querySelectorAll(".divTimeL")
		    	immediatelys(divTimeL)
				var timeY2 = document.querySelectorAll(".timeY")

				rankClick(timeY2)
		    },
		    error:function(res){
		    	$(".CRM_log").css("display","none")
				// console.log("错误")
		      	// console.log(res)
		    }
		});
    }
    //点击对话图标聊天
    function immediately(arrs){
    	Array.from(arrs).forEach(function(arrsa,arrsb){
    		arrsa.onclick = function(){
    			// console.log(arrsa.getAttribute("did"))
    			var behaviorJinDids = arrsa.getAttribute("did")
    			window.location.href= window.urls.url + `/user/message?user_id=${behaviorJinDids}&token=${window.tokens.token_boss}&corpid=${localStorage.getItem("CRM_corpId")}`
    		}
    	})
    }
    //点击左边进入个人详情
    function immediatelys(arrs){
    	Array.from(arrs).forEach(function(arrsa,arrsb){
    		arrsa.onclick = function(){
    			// console.log(arrsa.getAttribute("did"))
    			// var behaviorJinDids = arrsa.getAttribute("did")
    			window.location.href=window.urls.url + `/book/details?id=${arrsa.getAttribute("did")}&corpid=${localStorage.getItem("CRM_corpId")}`;
    		}
    	})
    }
	//点击进入排行榜
	function rankClick(arrs){
		Array.from(arrs).forEach(function(arrsa,arrsb){
			arrsa.onclick = function(){
				window.location.href=`?id=${arrsa.getAttribute("did")}#ranking`;
			}
		})
	}
    //行为统计
    function indexCenterBehavior(type,starts,ends){
    	// console.log(type,starts,ends)
    	// $("#loadss").css("display","block")
    	$(".CRM_log").css("display","block")
    	$.ajax({
		    url:window.urls.url + "/behavior/count",
		    type:"POST",
		    contentType: "application/json",
    		dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	type:type,
		    	timeInfo:{start:starts,end:ends},
		    	// corpid:localStorage.getItem("CRM_corpId")
		    }),
		    success:function(res){
		    	$(".CRM_log").css("display","none")
		    	// $("#loadss").css("display","none")
		        // console.log(res.data)
		        $(".card_shoppings").html(res.data.card_shopping)
		        $(".websites").html(res.data.website)
		        $(".wechat_nums").html(res.data.wechat_num)
		        $(".sharess").html(res.data.shares)

		        $(".browse").html(res.data.browse)
		        $(".shop").html(res.data.shop)
		        $(".save_phone").html(res.data.save_phone)
		        $(".praise").html(res.data.praise)
		        $(".callup").html(res.data.phone)
		        $(".audio").html(res.data.audio)
		        $(".email").html(res.data.coupon)
		    },
		    error:function(res){
		        console.log(res)
		        $(".CRM_log").css("display","none")
		    	// $("#loadss").css("display","none")

		    }
		});

    }
    //取消
	$(".btnNo").click(function(){
	 	$(".xuan").css("display","none")
	 	$(".xuan2").css("display","none")

	})
	 //确定--行为
	$(".btnYeso").click(function(){
	 	var qian = $(".qian").val()
	 	var hou = $(".hou").val()
		var qiandz = new Date(qian)
		var qiant = qiandz.getTime(qiandz) / 1000
		var houdz = new Date(hou)
		var hout = houdz.getTime(houdz) / 1000
		// console.log(qiant,hout)
		// console.log(qian,hou)
		hout = hout + 86400
		// console.log(hout,"退后一天")
		var cha = (hout - qiant) / 86400
		$(".indexDaysNew").html(cha)
		if(qiant<hout){
		 	indexCenterBehavior("all",qiant,hout)
		 	$(".xuan").css("display","none")

		}else{
			alert("请选择正确时间段（起始时间应小于结束时间）")
		}

	})
	 //选择时间--行为
	$(".topR1").click(function(){

	    $(".xuan").css("display","block")
	})
	 //确定--人
	$(".btnYeso2").click(function(){
	 	var qian2 = $(".qian2").val()
	 	var hou2 = $(".hou2").val()
		var qiandz2 = new Date(qian2)
		var qiant2 = qiandz2.getTime(qiandz2) / 1000
		var houdz2 = new Date(hou2)
		var hout2 = houdz2.getTime(houdz2) / 1000
		// console.log(qiant2,hout2)
		// console.log(qian,hou)
		hout2 = hout2 + 86400
		// console.log(hout2,"退后一天")
		// console.log(hout2,qiant2)
		var cha2 = (hout2 - qiant2) / 86400
		$(".indexDaysNew2").html(cha2)

		if(qiant2<hout2){
		 	// indexCenterBehavior("all",qiant2,hout)
		 	timeFirst = qiant2
		 	timeEnds = hout2
		 	// console.log("45646")
		 	var centerPeoperOnes = document.querySelectorAll(".centerPeoperOnes");
			Array.from(centerPeoperOnes).forEach(function(centerPeoperOnesa,centerPeoperOnesb){
			 	centerPeoperOnesa.remove()
			})
		 	centerPeoper(1,qiant2,hout2)
		 	$(".xuan2").css("display","none")
		 	if(document.querySelector(".renCenATu")){
				document.querySelector(".renCenATu").remove()
			}

		}else{
			alert("请选择正确时间段（起始时间应小于结束时间）")
		}

	})
	 //选择时间--人
	$(".topR2").click(function(){

	    $(".xuan2").css("display","block")
	})
	 //选择时间弹出框
	// $(document).ready(function(){
	// 	$("#dtBox").DateTimePicker();
	// });
	$("#dtBox").DateTimePicker({
		init: function()
		{
			var oDTP = this;
			oDTP.setDateTimeStringInInputField();
		}
	});
	var behaviorJin = document.querySelectorAll(".behaviorJin");
	Array.from(behaviorJin).forEach(function(behaviorJina,behaviorJinb){
	 	behaviorJina.onclick=function(){
	 		// console.log(behaviorJina.getAttribute("cid"))
	 		var behaviorJinCid = behaviorJina.getAttribute("cid")
	 		window.location.href= window.urls.url + `/radar/behavior?type=${behaviorJinCid}&corpid=${localStorage.getItem("CRM_corpId")}`
	 	}
	})
	//获取当前可视范围的高度
	function getClientHeight4() {
		var clientHeight = 0;
		if(document.querySelector("body").clientHeight && document.documentElement.clientHeight) {
			clientHeight = Math.min(document.querySelector("body").clientHeight, document.documentElement.clientHeight);
		} else {
			clientHeight = Math.max(document.querySelector("body").clientHeight, document.documentElement.clientHeight);
		}
		return clientHeight;
	}
	//赞我的人上拉加载
	$(".rankUser").on("scroll",function(){
		// console.log(getClientHeight4(), $(this).height(),$(this).scrollTop())
		if($(".rankUser-time").height() - getClientHeight4() + 45 == $(this).scrollTop()){
			// console.log("触底")
			if(rankUserJudge == 1){
				rankUserJudge = 0
				rankUserPage++
				var rankUserUrl = test.indexOf('?id=');
				rankUserAjax(test.slice(rankUserUrl+4,jin1),rankUserPage,sizeRen)
			}
		}
	})
	//获取当前可视范围的高度
	function getClientHeight1() {
		var clientHeight = 0;
		if(document.querySelector(".centerTime").clientHeight && document.documentElement.clientHeight) {
			clientHeight = Math.min(document.querySelector(".centerTime").clientHeight, document.documentElement.clientHeight);
		} else {
			clientHeight = Math.max(document.querySelector(".centerTime").clientHeight, document.documentElement.clientHeight);
		}
		return clientHeight;
	}
	//时间行为上拉加载
	$(".centerTime").on("scroll",function(){
		// console.log($(".firstTime").height() , $(this).height(),$(this).scrollTop())
		//
		// console.log($(".firstTime").height() - $(this).scrollTop(),$(this).scrollTop())
		if($(".firstTime").height() - getClientHeight1() + 45 == $(this).scrollTop() || $(".firstTime").height() - getClientHeight1() + 38 == $(this).scrollTop()){
			if(centerTimeJudge == 1){
				centerTimeJudge = 0
				indexFirstTimeNum++
				indexFirstTime(indexFirstTimeNum,i)
			}
		}
	})

	//获取当前可视范围的高度
    function getClientHeight2() {
        var clientHeight = 0;
        if(document.querySelector(".centerPeoper").clientHeight && document.documentElement.clientHeight) {
            clientHeight = Math.min(document.querySelector(".centerPeoper").clientHeight, document.documentElement.clientHeight);
        } else {
            clientHeight = Math.max(document.querySelector(".centerPeoper").clientHeight, document.documentElement.clientHeight);
        }
         return clientHeight-106;
    }
	//人互动上拉加载
    $(".centerPeoper").on("scroll",function(){
        if($(".centerPeoperss").height() - getClientHeight2() == $(this).scrollTop()){
            // console.log("滚动事件触发")
            if(peoperJudge == 1){
                peoperJudge = 0
                pageRen++
                centerPeoper(pageRen,timeFirst,timeEnds)
            }
        }
    })
	//获取排行可视范围的高度
	function getClientHeight3() {
		var clientHeight = 0;
		if(document.querySelector(".rank-alls").clientHeight && document.documentElement.clientHeight) {
			clientHeight = Math.min(document.querySelector(".rank-alls").clientHeight, document.documentElement.clientHeight);
		} else {
			clientHeight = Math.max(document.querySelector(".rank-alls").clientHeight, document.documentElement.clientHeight);
		}
		return clientHeight;
	}
	//排名上拉加载
	$(".rank-alls").on("scroll",function(){
		if($(".rank-allOne").height() - getClientHeight3() + 45 == $(this).scrollTop()){
			if(rankJudge == 1){
				rankJudge = 0
				rankPage++
				var typeUrl = test.indexOf('?id=');
				rankingAjax(rankPage,sizeRen,test.slice(typeUrl+4,jin1))
			}
		}
	})


	//人--互动数
	function centerPeoper(page,starts,ends){
		console.log(page,starts,ends)
	 	$.ajax({
		    url:window.urls.url + "/custom/list",
		    type:"POST",
		    contentType: "application/json",
    		dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	page:page,
		    	timeInfo:{start:starts,end:ends},
		    	size:sizeRen,
		    	// corpid:localStorage.getItem("CRM_corpId")
		    }),
		    success:function(res){
		    	$(".CRM_log").css("display","none")
		    	// console.log(res)
		      console.log(res.data)
		      // alert(res.data)
		      if(res.data.length < sizeRen){
		      	peoperJudge = 0
		      	$(".centerPeoperssD").html("没有更多数据了")
		      }
		      if(res.data.length > 0){
			      $.each(res.data, function(index, el) {
			      	if(el.nickname){
				      	var centerPeoperadd
				      	if(el.nickname.length > 5){
				      		centerPeoperadd =  $("<div class='one centerPeoperOnes' did='"+el.id+"'><div class='ongImg'><img src='"+el.avatar_url+"' alt=''></div><div class='oneNames'><div class='oneNamesL' style='width:60px;'>"+el.nickname+"</div><div class='oneNamesR'>与你在名片上互动了<span class='oneNamesRspan'>"+el.behavior_count+"</span>次</div></div><div class='oneRight'><i class='iconfont icon-arrow-right-copy'></i></div></div>")
					      	$(centerPeoperadd).appendTo(".centerPeoperss")
				      	}else{
					      	centerPeoperadd =  $("<div class='one centerPeoperOnes' did='"+el.id+"'><div class='ongImg'><img src='"+el.avatar_url+"' alt=''></div><div class='oneNames'><div class='oneNamesL'>"+el.nickname+"</div><div class='oneNamesR'>与你在名片上互动了<span class='oneNamesRspan'>"+el.behavior_count+"</span>次</div></div><div class='oneRight'><i class='iconfont icon-arrow-right-copy'></i></div></div>")
					      	$(centerPeoperadd).appendTo(".centerPeoperss")
				      	}
			      	}
			    })
			    peoperJudge = 1
		    }
		      centerPeoperOness()
		    },
		    error:function(res){
		    	$(".CRM_log").css("display","none")
		      	console.log(res)
		    }
		});
	}
	var centerPeoperOnesNum = 0;
	//打印人--互动详情框
	function centerPeoperOness(){
		var centerPeoperOnes = document.querySelectorAll(".centerPeoperOnes");
		Array.from(centerPeoperOnes).forEach(function(centerPeoperOnesa,centerPeoperOnesb){
		 	centerPeoperOnesa.onclick=function(){
		 		var behaviorJinDid = centerPeoperOnesa.getAttribute("did")
		 		if(centerPeoperOnesNum != behaviorJinDid){
		 			centerPeoperOnesNum = centerPeoperOnesa.getAttribute("did")
			 		if(document.querySelector(".renCenATu")){
						document.querySelector(".renCenATu").remove()
					}
	                // $(".log").css("display","block")
				// var name = ["个人魅力值","获客能力值","产品推广值","客户互动值","销售主动性","官网推广度"]

					var canva = "<div class='renCenATu' style='border-bottom:1px solid #eaeaea'></div>"
					var interactionOnes = document.querySelectorAll(".interactionOnes");
					Array.from(interactionOnes).forEach(function(interactionOnesa,interactionOnesb){
					 	interactionOnesa.remove()
					})
					interactionAjax(behaviorJinDid,timeFirst,timeEnds)
					$(this).after(canva)
		 		}else{
		 			centerPeoperOnesNum = 0;
		 			document.querySelector(".renCenATu").remove()
		 		}
                // analyzeAjax(dom.getAttribute("did"),document.getElementById("can2"))
		 		// window.location.href= window.urls.url + `/radar/custom/behavior?user_id=${behaviorJinDid}`
		 	}
		})
	}
	//打印人--互动详情
	function interactionAjax(type,starts,ends){
		$(".CRM_log").css("display","block")

        // console.log(type,starts,ends)
       $.ajax({
		    url:window.urls.url + "/behavior/custom",
		    type:"POST",
		    contentType: "application/json",
    		dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	user_id:type,
		    	timeInfo:{start:starts,end:ends},
		    	// page:page
		    	// timeInfo:{start:starts,end:ends}
		    }),
            success:function(res){
                // console.log(res)
                $(".CRM_log").css("display","none")
                var arr1 = [1,3,5,6,7,9,'a','b','c','d','f']
                if(res.data != ''){
	                res.data.forEach(function(el,index){
	                    var color = "#" + arr1[Math.ceil(Math.random() * 10)]  + arr1[Math.ceil(Math.random() * 10)] + arr1[Math.ceil(Math.random() * 10)] + arr1[Math.ceil(Math.random() * 10)] + arr1[Math.ceil(Math.random() * 10)] + arr1[Math.ceil(Math.random() * 10)]
	                    var divs = $("<div class='interactionOne'><div class='interactionOneL'>"+el.name+"</div><div class='interactionOneR'><div class='interactionT' style='width:"+el.num+"%;background:"+color+"'></div><div class='interactionF'>"+el.number+"</div></div></div>")
	                    $(divs).appendTo(".renCenATu")
	                })
                }else{
                	alert("暂无互动")
                }
            },
            error:function(res){
            	$(".CRM_log").css("display","none")
              	console.log(res)
              // alert("请求数据失败")
            }
        })
    }

 //消息
 	//渲染消息页面
	function informationAjax(){
		var chatList = localStorage.getItem('MESSAGE');
		$(".CRM_log").css("display","none")
		// console.log(JSON.parse(chatList))
		// unread  missionNum
		if(chatList == null){

		 	$.ajax({
			    url:window.urls.url + "/message/user",
			    type:"POST",
			    contentType: "application/json",
	    		dataType:"json",
			    data:JSON.stringify({
			    	token:window.tokens.token_boss,
			    }),
			    success:function(res){
			      // console.log(res.data)
				  if(res.data != ''){
				  	// $(".missionCen").css("display","none")
				  	message_one(res.data)
				  }else{
				  	$(".missionCen").css("display","block")
				  }
			    },
			    error:function(res){
			      // console.log(res)
			    }
			});
		}else{
			if(JSON.parse(chatList).length>0){
				// $(".missionCen").css("display","none")
				var arrTime = JSON.parse(chatList)
				message_one(arrTime)

			}else{
			  	$(".missionCen").css("display","block")
			}
			// informations()

		}
	}
	//渲染消息页面
	function message_one(arr){
		$(".missionCen").css("display","none")
		// console.log(arr)
		arr.sort(function(a,b){
	        if(a.time>b.time){
	            return -1;
	        }
	        if(a.time<b.time){
	           return 1;
	        }
	        return 0;
	    })
		// console.log(JSON.parse(chatList))
		arr.forEach(function(lista,listb){
			var display;
	      	if(lista.unread>0){
	      		display = "block"
	      	}else{
	      		display = "none"
	      	}
	      	var informationNum;
	      	if(lista.unread >= 99){
	      		informationNum = 99
	      	}else{
	      		informationNum = lista.unread
	      	}
			var informationPeo;
			var dateTmp = lista.time
			// console.log(dateTmp)
    		var newTimes = dateTmp.slice(0,16)
			if(lista.message_type == 1){
	      		informationPeo =  $("<div class='missionBot' did='"+lista.uid+"' ontouchstart='gtouchstart(this)' ontouchmove='gtouchmove(this)' ontouchend='gtouchend(this)'><div class='missionBotL'><img src='"+lista.head_img+"' alt=''><div class='missionNum' style='display:"+display+"'>"+informationNum+"</div></div><div class='missionBotC'><div class='missP1'>"+lista.user_name+"</div><div class='missP2'>"+lista.content+"</div></div><div class='missionBotR' id='del'>"+newTimes+"</div></div>")
	      	}
	      	if(lista.message_type == 2){

	      	}
	      	if(lista.message_type == 3){
	      		informationPeo =  $("<div class='missionBot' did='"+lista.uid+"' ontouchstart='gtouchstart(this)' ontouchmove='gtouchmove(this)' ontouchend='gtouchend(this)'><div class='missionBotL'><img src='"+lista.head_img+"' alt=''><div class='missionNum' style='display:"+display+"'>"+informationNum+"</div></div><div class='missionBotC'><div class='missP1'>"+lista.user_name+"</div><div class='missP2'>[图片]</div></div><div class='missionBotR' id='del'>"+newTimes+"</div></div>")
	      	}
	      	if(lista.message_type == 4){
				informationPeo =  $("<div class='missionBot' did='"+lista.uid+"' ontouchstart='gtouchstart(this)' ontouchmove='gtouchmove(this)' ontouchend='gtouchend(this)'><div class='missionBotL'><img src='"+lista.head_img+"' alt=''><div class='missionNum' style='display:"+display+"'>"+informationNum+"</div></div><div class='missionBotC'><div class='missP1'>"+lista.user_name+"</div><div class='missP2'>[商品]</div></div><div class='missionBotR' id='del'>"+newTimes+"</div></div>")
	      	}
	      	$(informationPeo).appendTo(".missionZ")
		})
	}

	//进入聊天页面
	function informations(){
		 var informations = document.querySelectorAll(".missionBot");
		 Array.from(informations).forEach(function(informationsa,informationsb){
		 	informationsa.onclick=function(){
		 		// console.log(informationsa.childNodes[0].childNodes[1])
		 		var behaviorJinDid = informationsa.getAttribute("did")
		 		document.querySelector(".read").innerHTML = document.querySelector(".read").innerHTML - informationsa.childNodes[0].childNodes[1].innerHTML
		 		if(document.querySelector(".read").innerHTML == 0){
		 			document.querySelector(".read").style.display = 'none'
		 		}
		 		var chatList2 = JSON.parse(localStorage.getItem('MESSAGE'));
		 		// console.log(chatList2)
		 		for(var i = 0; i< chatList2.length; i++){
		 			if(chatList2[i].uid == behaviorJinDid){
		 				// console.log(chatList2[i])
		 				chatList2[i].unread = 0
		 				// console.log(JSON.parse(chatList2)[i].uid,behaviorJinDid)
		 				// console.log(JSON.parse(localStorage.getItem('MESSAGE'))[i])
		 			}
		 		}
		 		// console.log("返回")
		 		localStorage.setItem('MESSAGE',JSON.stringify(chatList2));
		 		// console.log(JSON.parse(localStorage.getItem('MESSAGE')))
		 		informationsa.childNodes[0].childNodes[1].innerHTML = 0
		 		informationsa.childNodes[0].childNodes[1].style.display = 'none'

		 		window.location.href= window.urls.url + `/user/message?user_id=${behaviorJinDid}&token=${window.tokens.token_boss}&corpid=${localStorage.getItem("CRM_corpId")}`
		 	}
		 })
	 }



	var timeOutEvent=0;//定时器
	//开始按
	function gtouchstart(doms){
	    timeOutEvent = setTimeout(function(){
	    	if(confirm("是否删除该条聊天记录？")){
	    		$.ajax({
		            url:window.urls.url + "/message/delete",
		            type:"POST",
		            contentType: "application/json",
		            dataType:"json",
		            data:JSON.stringify({
		                token:window.tokens.token_boss,
		                uid:doms.getAttribute("did"),
		                // corpid:localStorage.getItem("CRM_corpId")
		            }),
		            success:function(res){
		                console.log(res)
		                if(res.data == "success"){
		                	var chatMassage = localStorage.getItem('MESSAGE');
				    		var chatMassageArr = JSON.parse(chatMassage)
				    		var indexs;
				    		chatMassageArr.forEach(function(dela,delb){
				    			if(dela.uid == doms.getAttribute("did")){
				    				// console.log(delb)
				    				indexs = delb
				    			}
				    		})
		                	chatMassageArr.splice(indexs,1)
				    		console.log("返回2856")
				    		localStorage.setItem('MESSAGE',JSON.stringify(chatMassageArr));
				    		doms.remove()
		                }
		            },
		            error:function(res){
		              console.log(res)
		              // alert("请求数据失败")
		            }
		        })
			    // chatMassageArr.splice(indexs,1)
	    		// console.log(chatMassageArr)
	    		// localStorage.setItem('MESSAGE',JSON.stringify(chatMassageArr));
	    		// doms.remove()
	    	}


	    	// console.log(doms)
	    },500);//这里设置定时器，定义长按500毫秒触发长按事件，时间可以自己改，个人感觉500毫秒非常合适
	    return false;
	};
	//手释放，如果在500毫秒内就释放，则取消长按事件，此时可以执行onclick应该执行的事件
	function gtouchend(doms){
	    clearTimeout(timeOutEvent);//清除定时器
	    if(timeOutEvent!=0){
	        var behaviorJinDid = doms.getAttribute("did")
		 		document.querySelector(".read").innerHTML = document.querySelector(".read").innerHTML - doms.childNodes[0].childNodes[1].innerHTML
		 		if(document.querySelector(".read").innerHTML == 0){
		 			document.querySelector(".read").style.display = 'none'
		 		}
		 		var chatList2 = JSON.parse(localStorage.getItem('MESSAGE'));
		 		// console.log(chatList2)
		 		for(var i = 0; i< chatList2.length; i++){
		 			if(chatList2[i].uid == behaviorJinDid){
		 				chatList2[i].unread = 0
		 			}
		 		}
				    		// console.log("返回2900")
		 		localStorage.setItem('MESSAGE',JSON.stringify(chatList2));
		 		// console.log(JSON.parse(localStorage.getItem('MESSAGE')))
		 		doms.childNodes[0].childNodes[1].innerHTML = 0
		 		doms.childNodes[0].childNodes[1].style.display = 'none'
		 		window.location.href= window.urls.url + `/user/message?user_id=${behaviorJinDid}&token=${window.tokens.token_boss}&corpid=${localStorage.getItem("CRM_corpId")}`
	    }
	    return false;
	};
	//如果手指有移动，则取消所有事件，此时说明用户只是要移动而不是长按
	function gtouchmove(){
	    clearTimeout(timeOutEvent);//清除定时器
	    timeOutEvent = 0;
	};

	//真正长按后应该执行的内容
	function longPress(doms){
	    timeOutEvent = 0;
	    //执行长按要执行的内容，如弹出菜单
	    // alert("长按事件触发发");
	}



	//通讯录
 	function bookAjax(){
 		var chatList = localStorage.getItem('MESSAGE');
		console.log(JSON.parse(chatList))
 		$.ajax({
		    url:window.urls.url + "/book/rate",
		    type:"POST",
		    contentType: "application/json",
		    dataType:"json",
		    data:JSON.stringify({
		        token:window.tokens.token_boss,
		        rate:[50,80,100],
		        // corpid:localStorage.getItem("CRM_corpId")
		    }),
		    success:function(res){
		    	$(".CRM_log").css("display","none")
		        // console.log(res.data)
		        $(".peoperNum").html(res.data[0])
		        $(".peoperNum1").html(res.data[1])
		        $(".peoperNum2").html(res.data[2])
		    },
		    error:function(res){
		    	$(".CRM_log").css("display","none")
		        console.log(res)
		        // alert("请求数据失败")
		    }
		})
 	}
 	//我的信息
 	function myAjax(){
 		$.ajax({
		    url:window.urls.url + "/my/user",
		    type:"POST",
		    contentType: "application/json",
		    dataType:"json",
		    data:JSON.stringify({
		      token:window.tokens.token_boss,
		      // corpid:localStorage.getItem("CRM_corpId")
		    }),
		    success:function(res){
				// console.log(res)
				// console.log(res.data)

				$(".CRM_log").css("display","none")
		  //       console.log(res.data.thirdapp.head_img)
		        if(localStorage.getItem("headImg")){
		        	if(JSON.parse(localStorage.getItem("headImg")).id != res.data.thirdapp.head_img){
		        		console.log("删除")
		        		if(localStorage.getItem("qrcodeImg")){
					    	localStorage.removeItem('qrcodeImg');
					    	// console.log(divNew)
					    }
					    if(localStorage.getItem("headImg")){
					    	localStorage.removeItem('headImg');
					    	// console.log(divNew)
					    }
					    if(localStorage.getItem("logoImg")){
					    	localStorage.removeItem('logoImg');
					    	// console.log(divNew)
					    }
		        	}else{
		        		console.log("继续")
		        	}
		        }


		      // console.log(res.data)
		      if(res.data.name){
		        $(".mynameM").html(res.data.name)
		      }
			  if(res.data.position){
		        $(".mynameZ").html(res.data.position)
			  }
			  if(res.data.thirdapp.name){
		        $(".mynameG").html(res.data.thirdapp.name)
			  }
		      if(res.data.userimg.url){
		      	document.querySelector(".myBotTLImg").src = res.data.userimg.url
		      }
		    },
		    error:function(res){
		    	$(".CRM_log").css("display","none")
		      // console.log(res)
		    }
		})
 	}


if (window.history && window.history.pushState) {
	// alert("11111")
    $(window).on('popstate', function() {
	// alert("22222")

    	var hashLocation = location.hash;
    	var hashSplit = hashLocation.split("#!/");
        var hashName = hashSplit[1];
        if (hashName !== '') {
	// alert("33333")

        	var hash = window.location.hash;
        	// alert(hash)
        	if (hash == '#activity') {
        		// console.log("进来了")
        		// console.log(document.querySelector(".bookPeosZ"))

        		if(document.querySelector(".bookPeosZ")){
        			// console.log("gsdfahfga")
	      			document.querySelector(".bookPeosZ").remove()
	      		}
	      		peoperAjax("activity")
        		// alert('#books');
        	}
        }
    });
    // window.history.pushState(null, null, "window.urls.url + '/radar/behavior?type=10'");
}
// window.onbeforeunload = function(){
// 	localStorage.setItem('judge',"true");//用户离开此页面改变缓存
// }
// wx.config({
//     beta: true,// 必须这么写，否则wx.invoke调用形式的jsapi会有问题
//     debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
//     appId: '', // 必填，企业微信的corpID
//     timestamp: , // 必填，生成签名的时间戳
//     nonceStr: '', // 必填，生成签名的随机串
//     signature: '',// 必填，签名，见 附录-JS-SDK使用权限签名算法
//     jsApiList: [] // 必填，需要使用的JS接口列表，凡是要调用的接口都需要传进来
// });

// $(function(){
//     pushHistory();
//     var bool=false;
//     setTimeout(function(){
//           bool=true;
//     },1500);
//     window.addEventListener("popstate", function(e) {
//       if(bool)
//         {
//                 alert('请勿返回，如有需要请直接关闭网页');
//         }
//         pushHistory();

//         }, false);
// });

//  function pushHistory() {
//     var state = {
//             title: "title",
//             url: "#"
//         };
//         window.history.pushState(state, "title", "#");
// }

</script>

</body>
</html>








